Re: new line using print

2010-10-14 Thread Shawn H Corey
On 10-10-13 04:16 PM, Amish Rughoonundon wrote: Hi, I would like to print a file under windows using perl but with the end of line character be only 0x0A and not 0x0D followed by 0x0A. Is there a way to set $\ to 0x0A so that every time I use print, it only prints 0x0A and NOT 0x0D followed by

Re: New-Line in Regular Expression

2006-09-08 Thread Romeo Theriault
Wow, thank you to everyone whom responded on this one, it's great to get really good responses. Rob, you have some really good points in your email and your code works great. Thank you. But there is one part that I don't fully understand. In this piece of the code, while () { if (/user ([\w.]

Re: New-Line in Regular Expression

2006-09-07 Thread John W. Krahn
Romeo Theriault wrote: > Hello, Hello, > I'm trying to match this line (or more than one) starting from > the words "user picard..." > > 8/28/2006 1:04:41 PM: Retrieving mail from host mail.maine.edu > [130.111.32.22], user picard... > 8/28/2006 1:04:45 PM: Mail retrieval failed, reason: POP3

Re: New-Line in Regular Expression

2006-09-07 Thread Rob Dixon
Romeo Theriault wrote: > > Hello, I'm trying to match this line (or more than one) starting from > the words "user picard..." > > 8/28/2006 1:04:41 PM: Retrieving mail from host mail.maine.edu [130.111.32.22], user picard... > 8/28/2006 1:04:45 PM: Mail retrieval failed, reason: POP3 Host did no

Re: New-Line in Regular Expression

2006-09-07 Thread D. Bolliger
Romeo Theriault am Donnerstag, 7. September 2006 22:42: > Hello, I'm trying to match this line (or more than one) starting from > the words "user picard..." > > 8/28/2006 1:04:41 PM: Retrieving mail from host mail.maine.edu > [130.111.32.22], user picard... > 8/28/2006 1:04:45 PM: Mail retrieval fa

RE: New-Line in Regular Expression

2006-09-07 Thread Charles K. Clarkson
Romeo Theriault wrote: : Hello, I'm trying to match this line (or more than one) starting from : the words "user picard..." : : 8/28/2006 1:04:41 PM: Retrieving mail from host mail.maine.edu : [130.111.32.22], user picard... : 8/28/2006 1:04:45 PM: Mail retrieval failed, reason: POP3 Host did : n

Re: New Line Character(s)

2005-10-27 Thread Daniel Kasak
Chris Devers wrote: On Wed, 26 Oct 2005, Timothy Johnson wrote: I think you can use \r instead of \n for Access and Excel. Are you sure about that? I thought Windows used \r\n as a pair (or \n\r?) for the line delimiter. But then, I don't do Windows anymore, so I could be wrong :

Re: New Line Character(s)

2005-10-26 Thread Stephen York
If you have \n on its own in Access or Excel you get a new line within a cell. Also if you only have \n all the way through the file, then you effectively have one huge record which can't be loaded into memory (size dependent); \r\n is required in windows to indicate the end of a line. \n only

RE: New Line Character(s)

2005-10-26 Thread Chris Devers
On Wed, 26 Oct 2005, Timothy Johnson wrote: > I think you can use \r instead of \n for Access and Excel. Are you sure about that? I thought Windows used \r\n as a pair (or \n\r?) for the line delimiter. But then, I don't do Windows anymore, so I could be wrong :-) -- Chris Devers }#UÙ¯¼~º

RE: New Line Character(s)

2005-10-26 Thread Timothy Johnson
I think you can use \r instead of \n for Access and Excel. -Original Message- From: Daniel Kasak [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 26, 2005 4:18 PM To: beginners@perl.org Subject: New Line Character(s) Greetings. I've got some Perl code that's inserting data into a MyS

RE: New Line / Chomp Query

2004-07-25 Thread David Clarke
the latest file which ends in the 0d0a. Maybe my code is not correct or unstable ? -Original Message- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Friday, 23 July 2004 22:17 To: David Clarke; [EMAIL PROTECTED] Subject: RE: New Line / Chomp Query David Clarke wrote: > Hi, d

Re: New Line / Chomp Query

2004-07-23 Thread James Edward Gray II
On Jul 23, 2004, at 7:56 AM, Bob Showalter wrote: Thanks. Is translation to LF performed on input/output (a la Windows), or is $/ set to CR on those systems? No translation. $/ was set to CR and even \n gave you a CR. Luckily, as I said before, Mac OS X is a much more native Perl, being in the U

RE: New Line / Chomp Query

2004-07-23 Thread Bob Showalter
James Edward Gray II wrote: > On Jul 23, 2004, at 7:16 AM, Bob Showalter wrote: > > > On Mac systems, the terminator is something different (not sure > > what), but the same concept applies as for Windows AFAIK. > > Mac OS 9 and below used a single CR (0x0D) as the line terminator. Thanks. Is t

Re: New Line / Chomp Query

2004-07-23 Thread James Edward Gray II
On Jul 23, 2004, at 7:16 AM, Bob Showalter wrote: On Mac systems, the terminator is something different (not sure what), but the same concept applies as for Windows AFAIK. Mac OS 9 and below used a single CR (0x0D) as the line terminator. Mac OS X is a "Unix-ish system", as you described it, and

RE: New Line / Chomp Query

2004-07-23 Thread Bob Showalter
David Clarke wrote: > Hi, does anyone know what the new line character value is in Hex for > a text file ? Is it "0d 0a" ? ASCII newline is 0x0A (decimal 10) On Unix-ish systems, text files end each line with a single newline. On Windows systems, text files end each line with a CR/LF pair (0x0D

Re: NEW LINE

2001-06-11 Thread Me
> A bit safer way to do this would be the following: Jos is right in principle, but wrong in one detail. Setting $/ to undef isn't the same as setting it to ''. Setting it to undef makes the <> input operator slurp the whole file.

Re: NEW LINE

2001-06-11 Thread Jos Boumans
That code is a bit tricky, since you're now changing the behaviour of $/ throughout the entire file A bit safer way to do this would be the following: open I, "yourfile.txt";#open a textfile for reading { local $/;#undef $/, which is essentially the same as $/ = '

Re: NEW LINE

2001-06-11 Thread Me
> Can anyone send me any solution > to read the paragraph from a text file? To read paragraphs (delimited by one or more blank lines (really blank, no spaces or tabs)), change the record separator from its default (newline) to the null string (''). $/ = ''; while (<>) { print;

Re: New line in Regular expression.

2001-05-23 Thread Timothy Kimball
japhy wrote: : On May 23, Timothy Kimball said: : : >2. Use the "s" modifier to treat the slurped-up file as a single string. : : The /s modifier changes the meaning of . only, and not ^ or $ -- see my : response. I stand corrected. In my defense, I don't use either of these modifiers often. :

Re: New line in Regular expression.

2001-05-23 Thread Jeff Pinyan
On May 23, Timothy Kimball said: >2. Use the "s" modifier to treat the slurped-up file as a single string. The /s modifier changes the meaning of . only, and not ^ or $ -- see my response. See chapter 5 of LPRE: http://www.pobox.com/~japhy/docs/LPRE.html#5.%20more%20pattern%20modifiers --

Re: New line in Regular expression.

2001-05-23 Thread Timothy Kimball
: this is what i tryed on the command prompt. : : perl -pi -e 's{^

Re: New line in Regular expression.

2001-05-23 Thread Jeff Pinyan
On May 23, pda said: > and come to the new line and also check whether if there is a in >the given file if it finds it has to replace with a other string. > >this is what i tryed on the command prompt. > >perl -pi -e 's{^