Read .txt notepad and write into excel

Hi, I am trying to read the notepad file and write the data into excel file.
Current steps using a read text file and store the data into a string variable. But when I pass this variable into the write range it’s throwing error can’t covert data into a string like this.

But these .txt data contains headers with data please tell me how can I write the same into excel.
@Palaniyappan @Lahiru.Fernando @HareeshMR @lakshman
Can I use a Generate Data Table Activity if yes how?
I didn;t use it before

1 Like

yah we can go for generate datatable


Cheers @balkishan

1 Like

@balkishan

Yes you can use Generate DataTable activity to do this. And also specify Column and NewLine seperator. If it contains headers then check first row as headers.

1 Like

Hi @Palaniyappan it’s worked but I am observing how it gives me the data. I have huge data to copy from txt to excel.

1 Like

usually when a string with propert delimiter either space or comma is passed to generate datatable activity it will conver tthe string to datatable variable and doesn’t matter with number of records in it
Cheers @balkishan

What to give in the Column separators and NewLine Separators

If you observe I have only space between the column.
image

Please suggest

Here how it gives me the data
image

But I want in separate columns bro

1 Like

@balkishan

Then specify ColumnSeperator as Space and Newlineseperator as NewLine.

1 Like

we can mention in the property panel like what is the separator
image

Cheers @balkishan

1 Like

you mean to like this or I have to give the space by pressing the tab
image

1 Like

Yes bro I am not able to find here what is seprater I can see only the space

1 Like

@balkishan

Yes its correct.

1 Like

Yah thats what we have as separator right buddy
Cheers @balkishan

1 Like

when I given the Space and NewLine, It’s just showing executing, not executing the next line
image

It’s executing here from the last three min.
image

If I remove the Space and NewLine then it’s executing in a sec.

@Palaniyappan

1 Like

@balkishan

In which variable, you saved output of Generate DataTable activity ?

1 Like

It’s working and writing the data when I removed the NewLine. But the data it’s giving me in a one cell.
Data Format In Excel
This is my data at initial all Header name are there then I have data of these headers in the txt file.


If you observe it’s merging the Columns Headers with eachother. But I want in seprate column. Basically I want to create a Separate Columns for each Headers. You can see the format of Headers.

If you observe it is separated by space not by -. comma is used to attach each keyword of one column.

@Palaniyappan @lakshman Please suggest

1 Like

I hope we need some delimiters to be added to the text file buddy
only then we can create a datatable with generate datatable activity
–see as of now it has created the datatable with space as delimiter and as we have a space across the text that alone got separated and created as datatable…
–so it implies the same that is we need proper delimiter along the text between each column and only then we can make this happen

Kindly correct me if i m wrong
Cheers @balkishan

1 Like

Yes bro, but how we I can create the deliminator can you give me an example.
It’s very simple bro At initial there are all header after that we have data in same format.
But I don’t know how to use delimiter to write the data in the diff -2 excel column.

Or is there any approach to achieve this.

can i have a view on the text file if possible may a screenshot
Cheers @balkishan

1 Like

it looks like a tab delimiter
try once with that as delimiter
Cheers @balkishan

1 Like

Not working bro, it’s merging the Headers and the data also