On Jun 19, 2006, at 22:45, Anthony Ettinger wrote:
# order matters
$raw_text =~ s/\015\012/\n/g;
$raw_text =~ s/\012/\n/g unless "\n" eq "\012";
$raw_text =~ s/\015/\n/g unless "\n" eq "\015";
Does it make any difference if I use s/\cM\cJ/cJ/ vs. s/\015\012/\n/
g ?
The regexp i
Anthony Ettinger wrote:
> On 6/19/06, John W. Krahn <[EMAIL PROTECTED]> wrote:
>> Anthony Ettinger wrote:
>> >># order matters
>> >>$raw_text =~ s/\015\012/\n/g;
>> >>$raw_text =~ s/\012/\n/g unless "\n" eq "\012";
>> >>$raw_text =~ s/\015/\n/g unless "\n" eq "\015";
>> >
>> > Does
On 6/19/06, John W. Krahn <[EMAIL PROTECTED]> wrote:
Anthony Ettinger wrote:
>># order matters
>>$raw_text =~ s/\015\012/\n/g;
>>$raw_text =~ s/\012/\n/g unless "\n" eq "\012";
>>$raw_text =~ s/\015/\n/g unless "\n" eq "\015";
>
> Does it make any difference if I use s/\cM\cJ/cJ/
Anthony Ettinger wrote:
>># order matters
>>$raw_text =~ s/\015\012/\n/g;
>>$raw_text =~ s/\012/\n/g unless "\n" eq "\012";
>>$raw_text =~ s/\015/\n/g unless "\n" eq "\015";
>
> Does it make any difference if I use s/\cM\cJ/cJ/ vs. s/\015\012/\n/g ?
The string "cJ" in your example
# order matters
$raw_text =~ s/\015\012/\n/g;
$raw_text =~ s/\012/\n/g unless "\n" eq "\012";
$raw_text =~ s/\015/\n/g unless "\n" eq "\015";
Does it make any difference if I use s/\cM\cJ/cJ/ vs. s/\015\012/\n/g ?
Since the newline convention is not necessarily the one in the
r
On Jun 13, 2006, at 20:26, Anthony Ettinger wrote:
I have to write a simple function which strips out the various
newlines on text files, and replaces them with the standard unix
newline \n
In Perl "\n" depends on the system, it is eq "\012" everywhere except
in MacOS pre-X, where it is "\01
Joshua Scott wrote:
> I'm trying to copy data from one database field to another. The problem is
> that the field contains various newline and other types of control
> characters. Whenever the script runs, it processes those as perl code
> instead of data like I'd like it to. How can I prevent i
anyways for the assistance!
Joshua Scott
Security Architect, CISSP
Jacobs Engineering
-Original Message-
From: Janek Schleicher [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 02, 2003 7:29 PM
To: [EMAIL PROTECTED]
Subject: Re: Newlines, control characters, etc
Joshua Scott wrote at W
Joshua Scott wrote at Wed, 02 Jul 2003 21:25:34 -0400:
> I'm trying to copy data from one database field to another. The problem is
> that the field contains various newline and other types of control
> characters. Whenever the script runs, it processes those as perl code
> instead of data like
At 02:34 PM 11/29/2001 +, [EMAIL PROTECTED] wrote:
If all you want to do is take lines from one file and put it in another, it
may be easier to do the following:
while ($_=) {
if (length($_) > 2) ## if there is something more than
a blank line (assuming you don't have
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 29, 2001 9:34 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: RE: newlines
>
>
>
> This is the program;
>
> format ILL =
> @<
line)
second line of text
when I write to the new textfile taking the content from the original
textfile it's still including the blank line when I don't want it to.
Can you change a delimiter?
> -Original Message-
> From: Carl Rogers [SMTP:[EMAIL PROTECTED]]
> Sent: 29
At 10:35 AM 11/29/2001 +, [EMAIL PROTECTED] wrote:
>Anyone know how to get rid of two new lines from one text file before
>writing to another
I'm sorry.I'm not clear as to what you mean. If you're trying to read the
lines below, you can change your default record delimiter from a single
new
13 matches
Mail list logo