I it possible split a text file content into different variables

Hi,
I am having a text file and I need to split into different variables. for Example, Please find the below data.

1,A,Yes
1,B,No
1,C,Yes
2,D,Yes
2,E,Yes
3,F,No
3,G,No

is it possible to split the above text into different Variables based on the number? Say all the data with 1 to be in one variable similarly for 2,3,etc.

Thanks!!

you can use read text file activity and store in one variable

after this split that variable with environment.newline

Thanks

Use Read CSV activity to read the text file into a data table DT.
Apply filters on the data table.

Get all the unique values from Column1 and store into a data table DTUnique.

For Each row in DTUnique
  //filtering using Select Method
  newDT = DT.Select("Column1='" + row(0).ToString + "'").CopyToDataTable
  //newDT contains all the 1 values in the first iteration
  //newDT contains all the 2 values in the second iteration ....
  
  //process the newDT and move to the next iteration...

Similarly do for other values.

https://docs.uipath.com/activities/docs/read-csv-file

Regards,
Karthik Byggari

can you please tell me how to get all the unique values from column 1

Assign activity -

DTUnique = DT.DefaultView.ToTable(True,“Column1”)

Regards,
Karthik Byggari

1 Like

@KarthikByggari,

Thank you!!

1 Like