Problem to convert csv to xlsx : double delimiter tab + comma

Hello :slight_smile: ,

I am trying to convert a csv file using ReadCsvFile activity , but the problem is that i need use the delimiter with both comma and tab but the activity allow me to use only one delimiter !!
Plus, when i use only one delimiter and save the output datatable into an xlsx file this is what happens :
1- Tab delimiter : It gives me a wrong format , all the data will be written in one line.
2-Comma Delimiter: It gives me an error telling me that the csv file is invalid.

Is there a way where i can use both of delimiters because that’s the only way to get the format i’m looking for.
Thanks.

or

1 Like

Hi,

Can you try the following steps?

  1. Read your csv file as text file using Read Text File activity. (Let’s say strData)
  2. Replace your tab to comma like strData = strData.Replace(chr(9),",") using Assign activity
  3. Create DataTable variable from strData using Generate DataTable activity with CSV parse option.

Regards,

5 Likes

Thank you for your answer :slight_smile: but i have to convert using both of tab and comma delimiter so these ways didn’t work for me :frowning:

Thank you for your answer :slight_smile: What type should strData be ? i put it as a string but still having a problem with the datatable
image

It is working thank you :slight_smile: it s just not giving me the same result as i do it manually

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.