How do I read from a file which has many lines with each one word and then write a file which just extends the words with something?
For example my imports.txt has these lines:
line1
line2
line3
now I want to get this app to write a new file (exported.txt) which exports something like this
line1, price1
line2, price1
line3, price1
all of the text which gets attached to the string is always the same.
const Int32 BufferSize = 128;
using (var FileStream = File.OpenRead("import.txt"))
{
using (var streamReader = new StreamReader(FileStream, Encoding.UTF8, true, BufferSize))
{
string line;
while((line = streamReader.ReadLine()) != null)
{
}
}
}
is this the right approach?