Write data from datatable to notepad

I have one datatable ( this data i write to excel ) :

image

and i want to write for example : value 100 to specific row and specific position in notepad ( like row 1, position 15)
Value 101 to specific row and specific position in notepad ( like row 1, position 25)

Do you have any idea how can i do this?

Hi,

How about the following?

result = leftMergin+String.Join(vbCrLf+leftMergin,dt.AsEnumerable.Select(Function(r) String.Join("",dt.Columns.Cast(Of DataColumn).Select(Function(c) String.Format("{0, 10}",r(c).ToString)))))

Main.xaml (7.9 KB)

If the above isn’t what you expect, can you share specific result text (as a file)?

Regards,

1 Like

thnx Yoichi for your idea ,
i fact is not exactly what i was looking .

This is the format of my file ( in fact is .004 file format) :

remove_dublicated.xaml (7.8 KB) here is my xaml file and excel file : exp_2.txt (14.1 KB)

image

I would like for each row to get values and to put in this .004 file ( or text file) and then to continue with the other row and to write the values of this row to another file…and so on.

this is how should looks first file :slight_smile:

Hi,

If possible, can you share input .004 file and result file which you expect?
It’s no problem if dummy data.

Regards,

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