Unable to read CSV file

#1

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.

#2

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
#3

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

#4

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

1 Like
#5

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:

#6

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

#7

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

image

#8

@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?

#9

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

#10

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

#11

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

1 Like
#12

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

#13

You can use Set Range action.

#14

Got it Captain

#15

Working Fine , thanks alot…5 cheers to you

2 Likes
#16

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
#17

Hii Aravindhan,

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

2 Likes