September 15th, 2012, 07:52 PM
A little direction
Well is what im wanting to do is attempt to write a program in C# that take a .txt doc and add your desired string or character at the beginning or end or both. I have no idea where to even start so I was hoping someone could shed some light on this for me.
Also while im at it, is it possible to take 2 separate .txt docs..lets say one is filled with the names of documents and the other is filled with links to the document, can you join them together, while placing lets say html or css(doesn't matter just string in general) code/tags at the beggining of the line, in between the title's and links of the documents and at the end also?
thanks in advance for any input
September 15th, 2012, 08:46 PM
Inserting, deleting, or modifying the contents of a text file pretty much follows this basic procedure:
1. Open two files, the text file as the input for reading, and a new temporary file for output to write to.
2. Read the input file, line by line, and write it to the output file, doing whatever else you need to do:
a. If you need to insert something before that line, then write it to the output file before you write that line you input.
b. If you need to delete that line, then do not write it out to the output file.
c. If you need to modify that line, then modify it and then write it to the output file.
3. When you are done, then close both files, delete the input file, and rename the temporary output file to the input file's old name.
And that's how you do it.
Yes, of course it's possible. That is exactly how we used to generate dynamic web pages with CGI (Common Gateway Interface).
You know how to write text files and you know how to read text files, so you just need to incorporate what you read with what you're writing. Could possibly get a bit tedious, but entirely doable.
September 16th, 2012, 07:24 AM
More like "A little forum spamming"
From this well-known page (note: you might want to read the entire thing):
substitute forums for newsgroups there.
I ♥ ManiacDan & requinix
This is a sig, and not necessarily
a comment on the OP:
don't be a help vampire
September 16th, 2012, 10:14 AM
thanks for the input, i found out streamwriter and Filestream are something i need to look at.
And i posted on other communities because there are great people at other ones as well and I like to look at all the different answers..I get to see it at different angles. didnt mean to cause you such an inconvenience