Unable to read CSV file

Hi All,

I am having some issue while trying to read a csv file, I don’t know if am following the right approach or not.

BOT is copying data from a csv file and storing the same in a variable and then from the variable, the data is copied to excel file.

On opening the excel file I am getting an error message.

Please help me.

Hi @karan_singh2a in Write to File action, you can only work with text files.
To write data to a .xlsx file, use Excel actions.

1 Like

Hi Alesia ,

Many thanks for replying.

As advised I am trying to read the CSV file via read function and saving the data in a String Variable .

I am opening excel file and pasting the data value from the variable,

The output/format is totally different in the excel file.

I want the same format which is in csv file.

Please refer below and kindly correct me i am using wrong approach.

Original data from CSV file looks like this

After copying from CSV file , the entire data got updated in the cell.
refer below.

All i want the format in the new excel file should be the same as in csv file.

Please help

So, basically, you need to get a table out of a string.
You can do it through 2 Split String actions.

1 Like

Thank you Dear Alesia for the above , i tried to follow as advised but unable to get success , may be am doing it wrong.

It will be great of you if you can share a sample code with me :slight_smile:

Can you share a sample csv file that you are using?

Hi Sure , please checkNew Microsoft Excel Worksheet.xlsx (8.9 KB)


@karan_singh2a I meant can you share the csv file that you need to read the data from, so I can use in a sample recording?

sure , so sorry , let me share.JIRA Service Desk 2019-05-31T12_06_38 0800.csv (1.1 KB)

Thank you @karan_singh2a here is a sample recording that works on my machine

csv to table.zip (772 Bytes)

It was made using RPA Express 2.3.1.

If you set the resulting table to Excel, it will look as follows

Thanks alot for your help , let me try and update you…

1 Like

Alesia , for setting the values in excel , do we manually need to open the excel file or we can use excel function to open the excel file

You can use Set Range action.

Got it Captain

Working Fine , thanks alot…5 cheers to you


Hi @karan_singh2a, @ashapkina

If you want to avoid looping the data into excel file, there is an another option in excel file where we could import the CSV file and change it to excel format.

There is a reference Bot file i have zipped with only keystrokes used and it is more faster than looping, please take a look into it.

Rpa_Projects.zip (13.9 KB)

Hope this helps :slight_smile:

1 Like

Hii Aravindhan,

Thank you , let me try with your bot as well.


All - I used the same recording but my csv file has columns that sometimes have commas as part of the value in it which i believe is messing up the whole reading part. Is there a work around for this? Please let me know.

Thanks in advance!