Hi,
I need a help regarding reading a line in a text file. I have some files with columns but some header information at the top. Some of these header lines begin with a *, and some of them with nothing. I have to read the 9th line and 5th column, then extract the number from here and save it to another text file.
I was thinking of some solutions.
1) I can delete the first 8 lines and read the columns straightforward .
2) I first read the 9th line and then the 5th column, by using f.readline() or etc. However, readline only reads the first line and I could not tell to read the 9th line.
I could not made neither of those solutions. The second would be much better because at the end I do not lose the header info. I have hundreds of these files, any help would be much appreciated.
Thanks
I need a help regarding reading a line in a text file. I have some files with columns but some header information at the top. Some of these header lines begin with a *, and some of them with nothing. I have to read the 9th line and 5th column, then extract the number from here and save it to another text file.
I was thinking of some solutions.
1) I can delete the first 8 lines and read the columns straightforward .
2) I first read the 9th line and then the 5th column, by using f.readline() or etc. However, readline only reads the first line and I could not tell to read the 9th line.
I could not made neither of those solutions. The second would be much better because at the end I do not lose the header info. I have hundreds of these files, any help would be much appreciated.
Thanks
Comment