Generate data table activity (keep empty cells within table range)

Hello community,

I am stuck with a problem.

I have datatable generated from text file (csv file) that I want to read and if there is an empty cell, my formatting gets destroyed because some columns have a mismatch then. For example if I read row 2 in the screenshot then the value of column currency is assigned to column reference which I want to avoid.

How can I avoid this?

Example in screenshot

@SenorChang

Ideally that would not be the case..can you check the input csv format properly is it having empty values with two commas surrounded

Cheers

The affected empty cell is also empty in the csv file. If that helps: the csv is generated from an online banking portal

@SenorChang

Can you show a screenshot or so..because ideally as mentioned if empty it would detect empty itself

Cheers

There is no blank space or anything

@SenorChang

If you give delimiter as semi colon then ideally it would take as blank

Cheers

I assume it is a missing setting in the wizard.

Why are you using Generate Data Table instead of Read CSV?

@SenorChang

Try csv parsing format option

Cheers

I tried but the problem is that I have several lines at the beginning of the file that are not part of the actual table I want to work with. Therefore, I read as text and remove those lines separately.

I tried but that options does not work at all. It does not separate the columns at all (instead all column values are in one item).

Read the text, remove those lines, write new text file, Read CSV…

How would that work anyway? If you read the text and store it as a string how would you know until which line to cut the text? And immediately when you convert the string to DT you loose the empty cells…

I solved it myself in the meantime!

Here is my solution in case someone else will hit that topic in the future…

  1. ‘Read text file’ activity to read the content
  2. Take the string and do a replace to replace “;;” with “; ;” (space between the semicolons)
  3. ‘Generate datatable from text’ activity to generate the DT

In this way I don’t loose empty cells within the table.

@Anil_G I found an older thread where you gave the hint with the blank between the separators so I tried to get that in my string. So thank you. :wink:

Cheers

1 Like

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