How to get latest Files based Alphabets value from below table.
Here in the below image i need to pick File7(BC)
How to get latest Files based Alphabets value from below table.
Here in the below image i need to pick File7(BC)
Hi
We can use SORT DATATABLE ACTIVITY and sort the excel
The steps involved will be like
—use a excel application scope and pass the file path as input
—inside the scope use a READ RANGE activity and get the output with a variable of type datatable named dt
—now use a SORT DATATABLE activity and mention the column in property panel
—and now use a assign activity like this
str_filepath = dt.Rows(0)(0).ToString
Where this str_filepath is a variable that holds the filepath
Cheers @Girish26
Hi @Girish26
If you are based on the alphabet value, then You can sort the data based on the value column in ascending order so that it will be sorted based on the alphabet.
Is this what you are looking for?
hahaha… and again… lol
That’s not working
Sort datatable is not helping in this scenario
You were almost done
Change the sort type in that property panel of sort datatable activity
If we change that A wil come first and then we can get the corresponding filepath for sure
Cheers @Girish26
Try below expression.
This was the shortest way I could find to sort a DataTable without having to create any new variables.
inputDT.DefaultView.Sort = "Values ASC"
inputDT = inputDT.DefaultView.ToTable
Where inputDT contains your input data. Use Write Range activity to write into Excel file and pass inputDT to it.
I need Latest version based on alphabets. Still im not getting proper output
Ex: File7 is the latest version(BC)
@lakshman
I need Latest version based on alphabets. Still im not getting proper output
Ex: File7 is the latest version(BC)
If you sort it based on Ascending or Descending order then also you won’t get it as latest file.