How to set Generate Data Table?

Hi
I have this text content want to write them to excel?
but not sure why the first line (phoneNo) doesnt appear in excel, only show the rest of the content.
also as the text is separated by ; how to do the setting in generate data table? I did in the second picture, but in excel it shows a space line first then next line shows my content. How to fix? Thanks

image

@koolrc812

Try column separator as ; + Environment.NewLine

Also remove use headers check box else the first line is taken as header, may be thats why your first line is missing

Cheers

1 Like

Thanks heaps! it works. but I have multiple text files, when they all write together in excel, theres no new line space in between them, how do I add it?

@koolrc812

You can add a blank row before adding new data…

For thta create a table with one blank row and use it before adding thw original data

Cheers

but where in generate data table activity has this function?

You need to use a build datatable to create a separate table with blank row…

Or one more alternative would be to add a new line in your string

So say the data from text file is str

Then use assign with

Str = ";" + Environment.Newline + str

This will add a new line from generate datatable automatically

Cheers

This way? doesnt create a new line.

image

@koolrc812

Can you add a blank space before ; " ;"

And also i hope your add header is unchecked

Cheers

It Works!!! Thanks heaps! yes the header is unchecked. Appreciated your help!

1 Like

Hi @Anil_G
How do I separate them in different cell in excel?
Eg. phoneNo in A1 and 123456789 in A2? then customerId in B1 and 2345678 in B2?
when more text content read, will automatically only write 123456789 in A3, 2345678 B3 etc. let it accumulate keep on going?

@koolrc812

For that use column separator as = …so tht it splits column on that

Cheers

I used this → " = …"+ Environment.NewLine
but doesnt work

@koolrc812

Not environment.Newline…

Leave the row separator/newline separator….change the column separator which you gave as "" this to "="

Hope this is clear

Cheers

Change to the below?

still doesnt separate. Environment.NewLine for me to clear the extra space line, if its not there, the extra space line will be back

@koolrc812

For string you will add it…like this

str = " = ;" + environment.Newline + str

And the acreenshot looks proper…

Also your newine separator is guess should be with semicolon and environment.newlineas stated above

";" + environment.newline

Cheers

its now separated after = and ;
but customerName=Alex Sam → separated as Alex in cell K1 Sam in cell K2
also would like eg. phoneNo in cell A1 and 123456789 in A2 cause now 123456789 is in B1

@koolrc812

Column separator "="

Newline separator ";" + envitonmant.newline

This should work for the shown data

If there are changes please show the new data to verify

Cheers

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