Okay, so I read in a file like this:
var testFileAll = readFile(testFilePath)
And now I want to do some work on each line, yet this doesn't work:
So is there no lines procedure for a file that's been read in? I really don't want to have to copy between memfiles, streams etc just to access each line.
import strutils
for line in testFileAll.split("\n"):
#your code
That will do it, thanks.
The only think that concerns me is writing the lines back to memory after ive edited them in some way, like a Regex routine does when it goes through the whole file.... I guess I will have to deal with that when I come to it.
Cheers
Because I have Regex already done that will only work on the whole file.
And I am going to use the splitLines iterator, but the file will also be in memory at the same time, in this day an age of large amounts of ram, and since I will only be dealing with certain types of source files I don't think that will be a major problem.