How to Getting a lot of column values?

Hi Guys,

how you doing ?

I have to get all columns values with the information inside evey cell. But i am not able to do this, i could not think in way that i can do this, so i got this scrip, that reads it by columns, but iam afraid that if i do it for every single column the information may got lost and without references from one to other, so how can i extract to get as result na intire line?

Here’s what i got extracting only the cells in a specified column:

It only returns the value of the cells in the colunm:
aef

How can i extract the intire line, not only the cell in the specified column like below, using this row logic that i used before:

1 Like

Hi @Lucas_Silva

Use Select Command NewDt=Datatable.Select(“[Id]<>‘’”).CopyToDatatable

Output Datatable=New Dt and pass string value

print the entire result

Thanks
Ashwin S

Hi AshwinS2,

Thanks for your attention,

could you please build me a xml of it, i tried here but it was not successfull.

@AshwinS2

i created the xaml but i got the following error.
can u look in to it.

NOTE: i am reading all the rows one by one
readrows.xaml (11.5 KB)

Book1.xlsx (8.5 KB)

Hi @Seem

if you want to get the data row.Use This instead .

dr_row_Str =DT1.Select(“[id] =‘1’”)

But if you want to get the value use this.

dt_row_Str =DT1.row(0)(0)

And as i can see in your xaml you are iterating in the datatable. by the way what exactly do you wnat to do !

cheer :smiley:

Happy learning :smiley:

3 Likes

i just wanted to iterate row by row, one by one

1 Like

Fine
Hope these steps would help you resolve this
—use a excel application scope and pass the file path as input
—inside the scope use a read range activity and get output with a variable of type datatable named dt
—now use a WHILE loop and mention the condition like this
counter < dt.columns.count
Where counter is a int32 variable defined in the variable panel with default value as 0
—inside the while loop use a FOR EACH ROW loop and pass the variable dt as input
—inside the for each row loop use a WRITE LINE and mention like this
row(counter).ToString

This will give all the row and all the column values in sequence in output panel

Hope this would help you
Cheers @Lucas_Silva

hI @Lucas_Silva

cHECK THIS BASED ON THAT YOU CAN LOOP THROUGH A DATATABLE
NewDT =DT1.Select(“[id] <>'’”).CopyToDatatable()
for each row in NEWDT
print the datatable

Thanks
Ashwin S

1 Like

Hi @Seem

Just use Foreachrow and you can achieve to iterate in your datatable.

cheers :smiley:

Happy learning :smiley:

3 Likes

I Did what you mentioned but the bot got stuck in a infinite loop, only returning this values below:

and it keeps showing the sequence again and again, would you help me ?

Use read range activity and generate a datatable then use for each row:

Assing:
Strings → Your datatable Values
ProcessID = row(0).toString
Name = row(1).toString
ID = row(2).toString

You will get your values