Read a Excel or CSV

Hi All,

I want to read a Excel or CSV and write back create a table using build data table…?
can anyone help me…

Thanks in advance

1 Like

Hello @tejaswi_nerella

You can use the activity “readrange” to read and save the data of a datatable.
You can use the output parameter to get your excel file inside a “datatable” variable

Is this what you are looking for ?

2 Likes

Hi @tejaswi_nerella,

To read Excel use Read Range activity into an Excel Application Scope. And to read CSV file use Read CSV activity.

In both of the cases you will get a Data Table output. Now you can use this Output as required in your workflow.

Thanks & Regards,
Apurba

1 Like

hi @VDEBAC

I want to read a Excel or CSV and writes back create a table using build data table…?

1.Read excel file
2.Create a table using build datatable
3.Write
i think this the process
but i don’t know this one is correct or not…

And i have doubt in this task writes back means change the data reverse order…?

In your example,

You can fuse point 2 and 3 using the output parameter of your readrange activity (a good tip : use ctrl+k to create variable in the correct expected format)

Then use a “write range” activity to paste the datatable that is contained in your variable.
It’s up to you, to rewrite (using “write range” activity) or to paste under (using “append” activity)

All these activities are available in excel application scope or in workbook. It depend if you need to open your file or not.

Have fun :slight_smile:

4 Likes

@VDEBAC Thanks…

1 Like

Don’t forget to close the topic by using the “solution” button on the post that is the most relevant.
It will help anyone to get the solution faster in the futur when reading the post.

Have a nice week-end :partying_face:

2 Likes

hi @VDEBAC

here i read range activity select excel file
next i use build data table → variable name: ChangeDT
then next i take output data table → variable name: OutputDT
next i use write range activity in this write range activity i put the variable name of output data table…

  • Its shows an error string cannot be converted into system.data.datatable

  • If i change the variable type of OutputDT it show error in output data table like
    system.data.datatable cannot be converted into string

Hello,

In the parameter of the readRange Activity, you have an “output”. Click in it and use control+K to create a variable in datable format.
Then use this variable in the write range activity.

No need to add the activity “build DT” and output DT.

UiPath is far more efficient :wink:

(You should use Build if you start a DT from scratch for example.)

2 Likes

@VDEBAC here the task is using build datatable…:slightly_smiling_face: