Split String | Compare Two Excel File Name

Hi All,
@Lahiru.Fernando @sandeep13
I have 2 excel files, named as: RPA_21_IND.csv and RPA_21_22_IND.xlsx
[Like that i have 10 excelFiles Eg: RPA_21_ABC.csv / RPA_21_22_ABC.xlsx]
I need to compare the two excel file names, How to split and get the last word of the file name?

Thanks
Muthu

1 Like

(FileName.Split("\“c).Last()).split(”."c).First()

This will give you the file name @muthu.m

1 Like

@HareeshMR
Thanks for your response.
I dnt want File Name.
I need only the last word of the file name.[IND]

Thanks
Muthu

1 Like

Then again split with underscore from the string you got above :slight_smile:

((FileName.Split("\“c).Last()).split(”.“c).First()).Split(”_"c).Last()

3 Likes

@HareeshMR

Thanks a lot!!
Its Working Fine!

Thanks
Muthu

1 Like

Happy to help @muthu.m,

But I have a doubt, Are you sure your file contains underscore(_) in every file?

If not, then it will error out :slight_smile:

1 Like

text=RPA_21_IND.csv
text.Split(".“c)(0).Substring(text.Split(”."c)(0).Length-3)

1 Like

Yes @HareeshMR
All Excel Files Contains “_”
As i asked above.

1 Like

Hi @HareeshMR

How do get the data from datatable by column name or column index?

I had read the data of 2 excel files and write into Datatable. Now I want to get the data from data table by column and write into specific column of final-output-excel file. Pls guide me…

In Data Table: Column A, B and C
To Excel File: Column N,O and P

Thanks
Muthu

Loop through the data table using For Each Row activity and you will get the value of each row using the values

row(“column name”).tostring and write it directly to final excel @muthu.m

1 Like

Thank u @HareeshMR :pray:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.