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
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
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, "
>
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{
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
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
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
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