Error in Reading CSV file

Thanks How to crct this format or other mehod…pls help

Hi,

In my environment, Read CSV can read both “downloadFikterTest.csv” and “New Text Document.csv” without error.
Do you have any error in reading these csv file in your environment?

Regards,

I am geeting either file name is invalid when delimeter is set to comma
or null if delimeter is set to tab

Hmmm…

There is another approach to read csv file. Can you try the following steps?

  1. Read csv file as string using Read Text File activity.

  2. Generate datatable from the string using Generate DataTable activity with csv parse option.

  3. Now, we can get datatable like using read csv.

Regards,

1 Like

okay Thank you so much

In generate data table I get only column separartor options by tab, space, new line. But it was better if it was comma. And if I select tab…some rows getting dstrubed

what if some are separated by tab and comma

This is not working for me

Generate dT has no comma separator option

Hi,

You don’t need to use wizard. The following image is settings for parse comma separated format to datatable. Can you try?

Regards,

works fine thanks.

But I have one more issue. Before headers have some description part how to remove it?
if split string—strVar.remove(0, Split(strVar,EnvironmentVariable.newLine)(0).length)
will show empty dt

Kindly look at this expression and crct if I am wrong

Hi,

Do you want to remove first line? If so, the following helps you.

text = System.Text.RegularExpressions.Regex.Replace(text,"^.*\n",String.Empty)

Regards,

No ist not removing. Its not empty line. It has data

ok in downloadFikter file attached above: just read the file as string and remove first description. Let me know if u can

Hi,

Can you check the following sample?

Sample20200611-3.zip (26.4 KB)


First 3 rows(lines not removed)

Hi,

We need remove first 5 lines.
Can you try the following expression?

 System.Text.RegularExpressions.Regex.Replace(text,"^(.*\n){5}",String.Empty)

Regards,

Thank You so much works fine

1 Like

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