Re: [Tutor] File parse

2007-07-19 Thread Tino Dai
On 7/18/07, Tiger12506 <[EMAIL PROTECTED]> wrote: >I sent a sample of the file "testin.txt" in the last email. Here are the > lines themsevles: Oh! Sorry. I didn't look in the attachments - I expected the lines in the email. My mistake. Try this ~~ :-P ## import

Re: [Tutor] File parse

2007-07-17 Thread Tiger12506
>I sent a sample of the file "testin.txt" in the last email. Here are the > lines themsevles: Oh! Sorry. I didn't look in the attachments - I expected the lines in the email. My mistake. Try this ~~ :-P ## import re infile = open("testin.txt","r") outfile = open(

Re: [Tutor] File parse

2007-07-17 Thread Tiger12506
> Here you go. > > I've been working on something like this, but it's mixing the 2. Thanks > for > helping me. Okay. But you still haven't given me a few lines of your input file. The "in.txt" that you are using in your code. > import re > > infile = open("in.txt","r") > outfile = open("out.tx

Re: [Tutor] File parse

2007-07-17 Thread Tiger12506
> I'm trying to parse a file and extract 'src=172.16.148.27 dst=10.52.10.10' > out of each line that contains 10.52.10.10, but get lost with writing the > information and am not sure if I should .re at all. Could you send a few lines of "in.txt"? I can help better. > import re > > infile = open("

[Tutor] File parse

2007-07-17 Thread Que Prime
I'm trying to parse a file and extract 'src=172.16.148.27 dst=10.52.10.10' out of each line that contains 10.52.10.10, but get lost with writing the information and am not sure if I should .re at all. import re infile = open("in.txt","r") outfile = open("out.txt", "w") for line in infile: r