I need to get names from one file and write them to another.
Lines of first file look like this:
a001 0 0 :N
a0100 0 0 :N
a1000 0 0 :N
Where a*** – name, first 0 – coord X, second 0 – coord Y, and :N – doesn’t matter.
Second file that I need to write must contain names from first file and instead first 0 and second 0 must be randoms numbers.
In the end, second file must looks like this:
a001 10 150 :N
a0100 0 20 :N
a1000 130 0 :N
How can I do this?
To read, try C++’s stream operators to read tokens: C++ Reading file Tokens
To write, try C++’s stream operators with
setwto line up the columns.