Order the list of files

Hi…

i have list of file… i want to order the file (like… 1,2,3,4,5,6,7 etc.,)

but i got this output.
image

How to order the file…

Thanks
Shyam

1 Like

Hi @Shyam_Pragash,

You want to sort by the number in parentheses, right?

Regards,
MY

@Shyam_Pragash

do this
assuming testList = your list variable,

assign testList =
testList.AsEnumerable.OrderBy(function(x) cint(system.Text.RegularExpressions.Regex.Match(x, "\(([\d]+)\)").Groups(1).Value)).tolist

image

then your list will be sorted

Hi @muhammedyuzuak

Yes…

The solution has been shared above.

It will come as an array only if you are pulling from a file as an appendix. You can make this field toArray instead of toList.

image

Main.xaml (12.3 KB)
@Shyam_Pragash

See the Output

image

sorry, this will work @Shyam_Pragash
Main.xaml (12.3 KB)

Hi @jack.chan

its working fine… Thanks :slight_smile:

1 Like

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