Re: loop through each line in a text file

2010-03-01 Thread qtrimble
On Feb 26, 6:19 pm, ru...@yahoo.com wrote: > On Feb 26, 2:21 pm, qtrimble wrote: > > > > > On Feb 26, 4:14 pm, OdarR wrote: > > > > > > below is just a sample.  There are well over 500,000 lines that need > > > > processed. > > > > > wer1999001 > > > >       31.2234      82.2367 > > > >       37

Re: loop through each line in a text file

2010-02-26 Thread alex goretoy
I smell homework -- http://mail.python.org/mailman/listinfo/python-list

Re: loop through each line in a text file

2010-02-26 Thread rurpy
On Feb 26, 2:21 pm, qtrimble wrote: > On Feb 26, 4:14 pm, OdarR wrote: > > > > below is just a sample.  There are well over 500,000 lines that need > > > processed. > > > > wer1999001 > > >       31.2234      82.2367 > > >       37.9535      82.3456 > > > wer1999002 > > >       31.2234      82.2

Re: loop through each line in a text file

2010-02-26 Thread John Posner
On 2/26/2010 4:21 PM, qtrimble wrote: fileIN = open(r"C:\testing.txt", "r") for line in fileIN: year = line[3:7] day = line[7:10] print year, day This is good since i can get the year and day of year into a variable but I haven't gotten any further. That's an excellent start.

Re: loop through each line in a text file

2010-02-26 Thread qtrimble
On Feb 26, 4:14 pm, OdarR wrote: > On 26 fév, 22:08, qtrimble wrote: > > > > > I'm a python newbie but I do have some basic scripting experience.  I > > need to take the line starting with "wer" and extract the year and day > > of year from that string.  I want to be able to add the year and day

Re: loop through each line in a text file

2010-02-26 Thread OdarR
On 26 fév, 22:08, qtrimble wrote: > I'm a python newbie but I do have some basic scripting experience.  I > need to take the line starting with "wer" and extract the year and day > of year from that string.  I want to be able to add the year and day > of year from the last line having "wer*" to th

Re: loop through each line in a text file

2010-02-26 Thread Alf P. Steinbach
* qtrimble: I'm a python newbie but I do have some basic scripting experience. I need to take the line starting with "wer" and extract the year and day of year from that string. I want to be able to add the year and day of year from the last line having "wer*" to the lines occurring in between

loop through each line in a text file

2010-02-26 Thread qtrimble
I'm a python newbie but I do have some basic scripting experience. I need to take the line starting with "wer" and extract the year and day of year from that string. I want to be able to add the year and day of year from the last line having "wer*" to the lines occurring in between "wer*" lines.