Re: [Tutor] Extracting lines in a file

2010-04-06 Thread bob gailer
On 4/6/2010 2:16 AM, ranjan das wrote: Hi, I am new to python, and specially to file handling. I need to write a program which reads a unique string in a file and corresponding to the unique string, extracts/reads the n-th line (from the line in which the unique string occurs). I say 'n-t

Re: [Tutor] Extracting lines in a file

2010-04-06 Thread Dave Angel
ranjan das wrote: Hi, I am new to python, and specially to file handling. I need to write a program which reads a unique string in a file and corresponding to the unique string, extracts/reads the n-th line (from the line in which the unique string occurs). I say 'n-th line' as I seek a gener

Re: [Tutor] Extracting lines in a file

2010-04-06 Thread Christian Witts
Alan Gauld wrote: "ranjan das" wrote For instance lets say the unique string is "documentation" (and "documentation" occurs more than once in the file). Now, on each instance that the string "documentation" occurs in the file, I want to read the 25th line (from the line in which the strin

Re: [Tutor] Extracting lines in a file

2010-04-06 Thread Alan Gauld
"ranjan das" wrote For instance lets say the unique string is "documentation" (and "documentation" occurs more than once in the file). Now, on each instance that the string "documentation" occurs in the file, I want to read the 25th line (from the line in which the string "documentation" oc

[Tutor] Extracting lines in a file

2010-04-05 Thread ranjan das
Hi, I am new to python, and specially to file handling. I need to write a program which reads a unique string in a file and corresponding to the unique string, extracts/reads the n-th line (from the line in which the unique string occurs). I say 'n-th line' as I seek a generalized way of doing