How to print the first column from csv file in uipath

uiautomation
uipath

#1

The CSV file which i have :—
DocId DocData
1 Ab
1 Cd
1 Ef
2 Gh
2 Ij

Then i am reading CSV file through Read CSV activity and creating one DataTable Variable
with name of DT1.After that through For Each Activity, i am printing first column of CSV file
like(1,1,1,2,2).To print this one i passed DT1 variable in for each row activity.When i am writing
row(“DocId”).Tostring in writeline Activity, i am able to print properly,But i don’t want to print in this way.
i want to assign CSV file data to variable,to do this one i am using Assign Activity inside
the body loop of for each row activity.like
Doc=DT1.Rows(IndexCount).ItemArray(0).ToString()
Here Doc is variable with type of string for Assign Activity,with help of this one storing
first column data to Doc variable.Then in writeline Activity,passing Doc variable.After that
when i am running it’s printing (1,1,1,1,1) which is not the expected result like(1,1,1,2,2)
What i need to modify to print proper result like (1,1,1,2,2).Please help me.


#2

Will this work for you?


#3

Can you please share the xaml file to print the first column from CSV file or what i need to modify in my mentioned steps to print first column?In writeLine Activity i want to print in column wise like as default uipath print


#4

please find the attached Sample workflow and let me know
read_csv_sample.zip (2.2 KB)

Regards,!!
Aksh


#5

@aksh1yadav Thanks aksh1yadav. It’s printing as i expected
.If i wanted to print like, if docid=1 then i want to keep docid as a constant and print only docdata with value of docid=1 like for docid =1 there are three docdata(Ab,Cd,Ef).Again if docid=2 encounters i want to keep docid as a constant and print only docdata with value of docid=2 like for docid =2 there are two docdata(Gh,Ij).Again if docid=3 encounters i want to keep docid as a constant and print docdata with value of docid=3 like for docid =3 there are one docdata(Kl).for same csv file i added one more docID 3.How to print this one ?

i tried with IF activity but it;s printing like for Docid=1
1 Ab
1Cd
1Ef

when Docid=2 encounters it’s printing
2Gh
2Ij

then How to print as i expected