Copying DataTable to textfile in Proper column format

Hello Everyone,
I am trying to paste columns from Data-Table to textfile, considering the format of columns remain same.
input file:
Screenshot (16)

output I am getting in textfile:

whereas output I want:

I have already used copy to clipboard activity, but its giving the same output.
please need help on this,
Thank You

You don’t copy/paste. Use the Excel activities (Read Range etc) to read the file into a datatable.
Then use Append to CSV or Write CSV depending upon your process.

Have you done the free training on the UiPath web site? It covers these kind of basic operations.

already did that way… its giving the same output.
Is there any way I can enter excel data to text file on specific locations…like Column1 of excel should be pasted in text file on position Col1 of text file, Entries of Column2 of excel could be pasted on textfile position Col31 and Column3 of Excel could be pasted on position Col 46 of text file?

Stop thinking of it in terms of pasting.

You read the Excel file and end up with a datatable. Then you manipulate the datatable (ie remove columns, reorder columns, etc). Then you write the datatable to a file.

If you want to remove columns, for example, you can use Filter Datatable.

If you want to change the order of columns, there are many posts on this here already.

Yes, I am working on a DataTable by reading the excel file, by pasting I meant to write on the text file, I want to write on the text file using the datatable values through a string variable.
And no need to change or remove the columns too.

Hi,

I hope it works for you.

ExcelToTextFile.xaml (9.6 KB)

Regards,
MY

Hi @Daniyal_Tahir ,

Can you try to use output datatable activity to convert datatable values to text and use write text file activity to print the text information into a text file?

Thanks