Arrange text files in ascending order

Hello @ruteesh_raju, try this:

  1. Use the “Directory.GetFiles” activity to get a list of all files in the specified folder.
  2. Use the “Assign” activity to create a new List of String to store the filenames.
  3. Use a For Each loop to iterate through each file path in the list of files.
  4. Inside the For Each loop, use the “Path.GetFileName” method to extract the filename from the file path.
  5. Use regular expressions to extract the numeric value from the filename.
  6. Use the “Convert.ToInt32” method to convert the extracted numeric value to an integer.
  7. Use the “Add” method to add the filename and its corresponding numeric value to the List of String.
  8. After the loop, use the “Sort” method to sort the List of String based on the numeric values.
  9. Use another For Each loop to iterate through the sorted List of String.
  10. Inside this loop, you can perform any necessary actions with the sorted filenames.