Re: newlines on win32, old mac, and unix

2006-06-19 Thread Xavier Noria
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

Re: newlines on win32, old mac, and unix

2006-06-19 Thread John W. Krahn
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

Re: newlines on win32, old mac, and unix

2006-06-19 Thread Anthony Ettinger
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/

Re: newlines on win32, old mac, and unix

2006-06-19 Thread John W. Krahn
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

Re: newlines on win32, old mac, and unix

2006-06-19 Thread Anthony Ettinger
# 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

Re: newlines on win32, old mac, and unix

2006-06-13 Thread Xavier Noria
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

Re: Newlines, control characters, etc

2003-07-03 Thread Rob Dixon
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

RE: Newlines, control characters, etc

2003-07-03 Thread Scott, Joshua
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

Re: Newlines, control characters, etc

2003-07-02 Thread Janek Schleicher
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

RE: newlines

2001-11-29 Thread Carl Rogers
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

RE: newlines

2001-11-29 Thread Bob Showalter
> -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 = > @<

RE: newlines

2001-11-29 Thread J . D . Gravestock
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

Re: newlines

2001-11-29 Thread Carl Rogers
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