Re: removing line feeds

2006-01-21 Thread Tom Phoenix
On 1/21/06, Bowen, Bruce <[EMAIL PROTECTED]> wrote: > I know how to get rid of the carriage returns using s/\n//g, but > haven't had any luck in finding the way to get rid of the line feeds > following the |fs. Have you tried using a substitution? A line feed is often the character "\x0A", in cas

Re: FW: removing line feeds

2006-01-21 Thread Tom Phoenix
On 1/21/06, Bowen, Bruce <[EMAIL PROTECTED]> wrote: > That did not work. I've looked into the file with a hex editor it > that's telling me there's a > hex 0D 0A 0D 0A after each |FS. I've tried all of the combinations > I can think of, none of which had any effect. The process seems > to work

Re: time()

2006-01-21 Thread Tom Phoenix
On 1/21/06, Rick Triplett <[EMAIL PROTECTED]> wrote: > I time stamp a lot of my file interactions with $stamp = time(), but > about one out of a hundred or so stamps gives me the system epoch > date instead of the true date. If your time() function ever gives you the epoch (zero or undef), that's

FW: removing line feeds

2006-01-21 Thread Bowen, Bruce
On Jan 21, 2006, at 21:43, Bowen, Bruce wrote: > Perhaps that file has mixed newline conventions? Does > > $entire_file_content =~ tr/\015\012//d; > > do what you need? > > -- fxn > > That did not work. I've looked into the file with a hex editor it > that's telling me there's a > hex 0D

Re: removing line feeds

2006-01-21 Thread Xavier Noria
On Jan 21, 2006, at 21:43, Bowen, Bruce wrote: Perhaps that file has mixed newline conventions? Does $entire_file_content =~ tr/\015\012//d; do what you need? -- fxn That did not work. I've looked into the file with a hex editor it that's telling me there's a hex 0D 0A 0D 0A after ea

FW: removing line feeds

2006-01-21 Thread Bowen, Bruce
On Jan 21, 2006, at 17:28, Bowen, Bruce wrote: > I have files with this format > > text > text > |fs > > text > text > text > |fs > > The goal here is to make this data into a flat file of continuous > text (including the |fs).texttext|fstexttexttext|fs > > I know how to get rid of the carr

Reading RSS/XML feeds

2006-01-21 Thread Mike Blezien
Hello, We attempting to write a script that will read an RSS feed and write that feed, item-by-item, into an HTML webpage. The RSS feed that will serve as the source is at http://earthquake.usgs.gov/recenteqsww/catalogs/eqs7day-M2.5.xml The script will update a HTML template page when execute

time()

2006-01-21 Thread Rick Triplett
I time stamp a lot of my file interactions with $stamp = time(), but about one out of a hundred or so stamps gives me the system epoch date instead of the true date. Correct me if I'm wrong, but I am assuming that the time() function makes a system call, and that it can be checked for failu

Re: removing line feeds

2006-01-21 Thread Xavier Noria
On Jan 21, 2006, at 17:28, Bowen, Bruce wrote: I have files with this format text text |fs text text text |fs The goal here is to make this data into a flat file of continuous text (including the |fs).texttext|fstexttexttext|fs I know how to get rid of the carriage returns using s/\n/

Re: removing line feeds

2006-01-21 Thread Shawn Corey
Bowen, Bruce wrote: I know how to get rid of the carriage returns using s/\n//g, > but haven't had any luck in finding the way to get rid > of the line feeds following the |fs. Sorry, \n means a line feed. Try: s/\n//g; # Remove line feeds s/\r//g; # Remove carriage returns See: perldoc p

removing line feeds

2006-01-21 Thread Bowen, Bruce
I have files with this format text text |fs text text text |fs The goal here is to make this data into a flat file of continuous text (including the |fs).texttext|fstexttexttext|fs I know how to get rid of the carriage returns using s/\n//g, but haven't had any luck in finding the way to

Re: somthing wrong with my codes???

2006-01-21 Thread Shawn Corey
chen li wrote: #!/usr/bin/perl use warnings; use strict; my $string="password=xyz verbose=9 score=0"; my @keys=(); my @values=(); while ($string=~/(\w+)=(\w+)/g){ @keys=push(@keys, $1); push @keys, $1; print $1, "\n"; @values=push(@values,$2); push @values, $2; print $2,

Re: loop Question

2006-01-21 Thread John W. Krahn
Ron McKeever wrote: > I wanted to print if it matches my range of IP's. I thought I could use the > (#..#) and it would work, but it didn't: > > #!/usr/bin/perl -nlw > > # Print if Ip's are in > # 111.9.1-18.### or > # 111.9.20-100.### > # range > # > my $a="1-18"; > my $b="20-100"; > > wh

Re: Add comment to a pattern matched file line

2006-01-21 Thread John W. Krahn
Vincent Li wrote: > Hi List: Hello, > I have two files like this: > > file1: > score CN_SUBJ_PROMOTE3.100 # [0.000..3.100] > score CN_SUBJ_PROMOTION 3.600 # [0.000..3.600] > score CN_SUBJ_PROVIDE3.000 # [0.000..3.000] > > file2: > CN_SUBJ_PROMOTE > C

Re: somthing wrong with my codes???

2006-01-21 Thread Brano Gerzo
chen li [cl], on Friday, January 20, 2006 at 21:33 (-0800 (PST)) wrote these comments: cl> one array and xyz, 9 and 0 into another array. But I cl> don't get what I expect. I just wonder what is wrong? nothing is wrong, you wrote good script. But if you want print values, use at beginning: $|++;