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
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.]
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
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
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
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
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 :
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
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Ù¯¼~º
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
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
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
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
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
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
> 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.
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 $/ = '
> 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;
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. :
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
--
: this is what i tryed on the command prompt.
:
: perl -pi -e 's{^
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{^
22 matches
Mail list logo