RE: Stripping windows CR/LF characters

2002-01-28 Thread IT Workflow - Terry Honeyford
Got it sorted! I had already put the \n on the line before printing with no success, but I followed chomp with a chop, and it worked a treat! I think that chomp was removing the Carriage return but not line feed (maybe the other way round), the chop just removes the last character (which after c

Re: Stripping windows CR/LF characters

2002-01-25 Thread Johnathan Kupferer
Brett W. McCoy wrote: >On Fri, 25 Jan 2002, IT Workflow - Terry Honeyford wrote: > >>I am trying to print out only the lines that begin with Either "Unable to >>attach to", OR "Backup of" >>and append to the line "NOT OK" or "OK" depending on which match I get >>Here is the offending bit of scrip

RE: Stripping windows CR/LF characters

2002-01-25 Thread Brett W. McCoy
On Fri, 25 Jan 2002, IT Workflow - Terry Honeyford wrote: > I am trying to print out only the lines that begin with Either "Unable to > attach to", OR "Backup of" > and append to the line "NOT OK" or "OK" depending on which match I get > Here is the offending bit of script... > > open (FILE, " >

RE: Stripping windows CR/LF characters

2002-01-25 Thread IT Workflow - Terry Honeyford
I am trying to print out only the lines that begin with Either "Unable to attach to", OR "Backup of" and append to the line "NOT OK" or "OK" depending on which match I get Here is the offending bit of script... open (FILE, "){ chomp; if (m/^Unable to attach to/){ $line .= "$_ \t NOT OK"; }elsif{

RE: Stripping windows CR/LF characters

2002-01-25 Thread Timothy Johnson
AM Subject: Stripping windows CR/LF characters I am reading a line at a time of a windows log file and want to strip off the CR or LF characters at the end of the line chomp seems to have a weird effect (returning the cursor to the beginning of the line!) I am sure there is a regex to do this (similar t

Re: Stripping windows CR/LF characters

2002-01-25 Thread Brett W. McCoy
On Fri, 25 Jan 2002, IT Workflow - Terry Honeyford wrote: > I am reading a line at a time of a windows log file > and want to strip off the CR or LF characters at the end of the line > chomp seems to have a weird effect (returning the cursor to the beginning of > the line!) > I am sure there is a

RE: Stripping windows CR/LF characters

2002-01-25 Thread Hanson, Robert
This should work... s/\n\r?$/gm MS line endings are ASCII 10, 13. Rob -Original Message- From: IT Workflow - Terry Honeyford [mailto:[EMAIL PROTECTED]] Sent: Friday, January 25, 2002 11:27 AM To: [EMAIL PROTECTED] Subject: Stripping windows CR/LF characters I am reading a line at a

Stripping windows CR/LF characters

2002-01-25 Thread IT Workflow - Terry Honeyford
I am reading a line at a time of a windows log file and want to strip off the CR or LF characters at the end of the line chomp seems to have a weird effect (returning the cursor to the beginning of the line!) I am sure there is a regex to do this (similar to s/\cM//g for MAC line endings) but I