Re: Append new line at end of non-quoted text

2014-05-23 Thread Shawn H Corey
On Fri, 23 May 2014 15:52:11 -0700 Jim Gibson wrote: > Use the 'use warnings;' pragma in your program instead of '-w' on the > first line. That way, you can control which messages are issued. > Some modules have to do unsafe things to get the job done; it's the only way. But they do have the co

Re: Append new line at end of non-quoted text

2014-05-23 Thread Jim Gibson
Please post messages to the list, not to me personally. That way, you will get better answers sooner. On May 23, 2014, at 3:13 PM, Sherman Willden wrote: > Thank you, Jim; > > How do I get rid of the warning message without getting rid of the -w switch? Use the 'use warnings;' pragma in your p

Re: Append new line at end of non-quoted text

2014-05-23 Thread Hal Wigoda
print pi * 2, "\n"; On Fri, May 23, 2014 at 4:45 PM, Sherman Willden wrote: > Disclaimer: I am 67 and not in school. I am doing this for my own > satisfaction. > > How do I get a new line at the end of a non-quoted text. I am doing the > following: > Use Math::Trig;

Re: Append new line at end of non-quoted text

2014-05-23 Thread Jim Gibson
On May 23, 2014, at 2:45 PM, Sherman Willden wrote: > Disclaimer: I am 67 and not in school. I am doing this for my own > satisfaction. > > How do I get a new line at the end of a non-quoted text. I am doing the > following: > Use Math::Trig; > print pi * 2; > print

Append new line at end of non-quoted text

2014-05-23 Thread Sherman Willden
Disclaimer: I am 67 and not in school. I am doing this for my own satisfaction. How do I get a new line at the end of a non-quoted text. I am doing the following: Use Math::Trig; print pi * 2; print "\n"; How do I get the new line on the same line of code? I could do my $my_pi_time

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

new line using print

2010-10-14 Thread Amish Rughoonundon
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 0x0A. Any other method would also be welcomed. Than

Re: Regex problem, #.*# on new line

2009-03-11 Thread John W. Krahn
Brent Clark wrote: Hiya Hello, I got a string like so, and for the likes of me I can get regex to have it that each line is starts with #abc#. my $a = "#aaa#message:details;extra:info;variable:times;#bbb#message:details;extra:info;variable:times;#ccc#not:always;the:same;ts:14:00.00;"; $

Regex problem, #.*# on new line

2009-03-11 Thread Brent Clark
Hiya I got a string like so, and for the likes of me I can get regex to have it that each line is starts with #abc#. my $a = "#aaa#message:details;extra:info;variable:times;#bbb#message:details;extra:info;variable:times;#ccc#not:always;the:same;ts:14:00.00;"; $a =~ s/(?join( "\n", split(/#.*

Re: Replacing the n'th line with the new line

2007-08-13 Thread Chas Owens
On 8/12/07, Mr. Shawn H. Corey <[EMAIL PROTECTED]> wrote: snip > >> perl -pi -le '$_ = "something" if $. == 10' your_file > > > > So if this was in a script rather than a oneliner how would it work? > > I was playing and can not get it to work in an actual test script. > > Not surprising since it's

Re: Replacing the n'th line with the new line

2007-08-12 Thread Jeff Pang
-Original Message- >From: [EMAIL PROTECTED] >Sent: Aug 11, 2007 9:58 PM >To: beginners@perl.org >Subject: Re: Replacing the n'th line with the new line > >On Aug 9, 6:46 am, [EMAIL PROTECTED] (Chas Owens) wrote: >> On 8/8/07, Jeff Pang <[EMAIL PROTECTED]&

Re: Replacing the n'th line with the new line

2007-08-12 Thread Mr. Shawn H. Corey
[EMAIL PROTECTED] wrote: On Aug 9, 6:46 am, [EMAIL PROTECTED] (Chas Owens) wrote: On 8/8/07, Jeff Pang <[EMAIL PROTECTED]> wrote: snip> perl -pi -e '$i++;s/^.*$/something/ if $i==10' your_file snip There is no need to keep track of the number of lines with a separate variable. Perl already do

Re: Replacing the n'th line with the new line

2007-08-12 Thread uglykidtim
On Aug 9, 6:46 am, [EMAIL PROTECTED] (Chas Owens) wrote: > On 8/8/07, Jeff Pang <[EMAIL PROTECTED]> wrote: > snip> perl -pi -e '$i++;s/^.*$/something/ if $i==10' your_file > > snip > > There is no need to keep track of the number of lines with a separate > variable. Perl already does this with the

Re: Replacing the n'th line with the new line

2007-08-09 Thread Chas Owens
On 8/8/07, Jeff Pang <[EMAIL PROTECTED]> wrote: snip > perl -pi -e '$i++;s/^.*$/something/ if $i==10' your_file snip There is no need to keep track of the number of lines with a separate variable. Perl already does this with the $. variable. Also, a regex that replaces everything is pointless, j

Re: Replacing the n'th line with the new line

2007-08-08 Thread Jeff Pang
-Original Message- >From: Subhash <[EMAIL PROTECTED]> >Sent: Aug 8, 2007 10:34 PM >To: beginners@perl.org >Subject: Replacing the n'th line with the new line > >Hi > >Is there any way to update the specified line in the file with the new >line with

Re: Replacing the n'th line with the new line

2007-08-08 Thread Mr. Shawn H. Corey
Subhash wrote: Hi Is there any way to update the specified line in the file with the new line without having to copy the entire contents once again. Since the file is huge, i dont want to re-write the file. Can anyone suggest me how to do this If the line you are replacing is the same size as

Replacing the n'th line with the new line

2007-08-08 Thread Subhash
Hi Is there any way to update the specified line in the file with the new line without having to copy the entire contents once again. Since the file is huge, i dont want to re-write the file. Can anyone suggest me how to do this Thanks Subhash -- To unsubscribe, e-mail: [EMAIL PROTECTED] For

Re: New-Line in Regular Expression

2006-09-08 Thread Romeo Theriault
> but when I try running the code it doesn't match the lines. I've > tracked it down to the new line character after the three dots at the > end of the first line. But I can't figure out how to get past it. The > \n don't work. I've tried using chomp and then

Re: New-Line in Regular Expression

2006-09-07 Thread John W. Krahn
val failed, reason: POP3 Host did not > acknowlege password and returned following error: -ERR \[AUTH\] Invalid > login > > I seem to be matching it in ActiveState's regular expression toolkit, > but when I try running the code it doesn't match the lines. I've &

Re: New-Line in Regular Expression

2006-09-07 Thread Rob Dixon
Host did not acknowlege password and returned following error: -ERR \[AUTH\] Invalid login > > I seem to be matching it in ActiveState's regular expression toolkit, > but when I try running the code it doesn't match the lines. I've > tracked it down to the new line charac

Re: New-Line in Regular Expression

2006-09-07 Thread D. Bolliger
(A|P)M: Mail retrieval failed, reason: POP3 Host did not > acknowlege password and returned following error: -ERR \[AUTH\] > Invalid login > > I seem to be matching it in ActiveState's regular expression toolkit, > but when I try running the code it doesn't match the lines. I'

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

New-Line in Regular Expression

2006-09-07 Thread Romeo Theriault
UTH\] Invalid login I seem to be matching it in ActiveState's regular expression toolkit, but when I try running the code it doesn't match the lines. I've tracked it down to the new line character after the three dots at the end of the first line. But I can't figure out

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

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 d

New Line Character(s)

2005-10-26 Thread Daniel Kasak
xes instead of new lines. What should I use to get Access to display a new line? -- Daniel Kasak IT Developer NUS Consulting Group Level 5, 77 Pacific Highway North Sydney, NSW, Australia 2060 T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989 email: [EMAIL PROTECTED] website: http://www.nusconsulting.c

new line "\n" for print file

2005-03-31 Thread Brian Volk
Hello, Can someone explain how I can add "\n" to this line of code If that is really my problem.. :~) copy ($print_file, '//hp-exch/HP4100-IS'); The reason I ask is here's what I'm printing; (teminal veiw) --begin Green Solutions Industrial Cleaner is a non-toxic, heavy-duty produc

RE: How to remove new line chars

2004-10-21 Thread Bob Showalter
Abhishek Dave wrote: > I am stucking with my problem of reading xml file , > I am trying to remove the new line chars form xml file and just > readout the xml tags. If you're trying to parse XML, use an XML parser. http://perl-xml.sourceforge.net/faq/ -- To unsubscribe,

Re: How to remove new line chars

2004-10-21 Thread Willy West
On Thu, 21 Oct 2004 11:23:59 -0400 (EDT), Steve Bertrand <[EMAIL PROTECTED]> wrote: > > I am stucking with my problem of reading xml file , > > I am trying to remove the new line chars form xml file and just > > readout the xml tags. > > > > Please any guys

Re: How to remove new line chars

2004-10-21 Thread Steve Bertrand
> I am stucking with my problem of reading xml file , > I am trying to remove the new line chars form xml file and just > readout the xml tags. > > Please any guys have a look at this one. > please guide me some good stuff abut regex in perl . perldoc perlretut perldoc perlre

How to remove new line chars

2004-10-21 Thread Abhishek Dave
I am stucking with my problem of reading xml file , I am trying to remove the new line chars form xml file and just readout the xml tags. Please any guys have a look at this one. please guide me some good stuff abut regex in perl . Thanks and Regards, abhishek

Re: how to skip new line character

2004-09-09 Thread Bee
open F, "file.txt"; my @file = ; chomp @file; print "@file"; Is that what you want ? - Original Message - From: "Anish Kumar K." <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Thursday, September 09, 2004 2:41 PM Subject: how to skip new lin

Fwd: how to skip new line character

2004-09-08 Thread David le Blanc
-- Forwarded message -- From: David le Blanc <[EMAIL PROTECTED]> Date: Thu, 9 Sep 2004 16:54:56 +1000 Subject: Re: how to skip new line character To: "Anish Kumar K." <[EMAIL PROTECTED]> Is the problem either 1) Remove the end of line character from all line

how to skip new line character

2004-09-08 Thread Anish Kumar K.
Hi All As a beginner in PERL, I wrote a small program which reads data from the file and stores in an array. In that process i wanted to skip the new line character... for ex: In my program say "a.txt" contains man pan tan In the program open INPUT,"a.txt" or die $!;

RE: New Line / Chomp Query

2004-07-25 Thread David Clarke
Codes goes along this way : $current_record = $_; if (substr($current_record, 0, 6) eq 'GRSUMC') { # Remove new line marker chomp($current_record = $current_record); # Attach run no to end of record $current_record = $current_record . $ru

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 w

New Line / Chomp Query

2004-07-22 Thread David Clarke
Hi, does anyone know what the new line character value is in Hex for a text file ? Is it "0d 0a" ? I'm trying to read in a line of text, chomp it, attach 3 digits at the end of this line, then write this line to output file. But when I write it out, the original input line

Re: remove '\' with new-line

2004-03-03 Thread Jeff Westman
david <[EMAIL PROTECTED]> wrote: > Jeff Westman wrote: > > > I need a one-liner to convert all occurances read from a Unix > pipe > > of > > > > 'backslash' + 'literal new line (hex 0a)' > > > > to become just > >

Re: remove '\' with new-line

2004-03-02 Thread John W. Krahn
Jeff Westman wrote: > > I need a one-liner to convert all occurances read from a Unix pipe > of > > 'backslash' + 'literal new line (hex 0a)' > > to become just > > 'literal new line (hex 0a)' > > That is, remove the '\&#

Re: remove '\' with new-line

2004-03-02 Thread david
Jeff Westman wrote: > I need a one-liner to convert all occurances read from a Unix pipe > of > > 'backslash' + 'literal new line (hex 0a)' > > to become just > > 'literal new line (hex 0a)' > > That is, remove the '\'

remove '\' with new-line

2004-03-02 Thread Jeff Westman
I need a one-liner to convert all occurances read from a Unix pipe of 'backslash' + 'literal new line (hex 0a)' to become just 'literal new line (hex 0a)' That is, remove the '\' only when it preceeds a new-line. Again, this must be read from a p

RE: Spreadsheet::WriteExcel - Unix New line

2003-01-16 Thread Jenda Krynicky
script that generates an excel file. I tested it on > a windows xp pro machine and everything was ok. When I put > the script on the UNIX server and run it I get blocks on my > excel sheet where new lines occurred. How can I have the UNIX > Perl write out Microsoft new line charact

RE: Where is the new line coming from.

2003-01-16 Thread Dan Muey
> Paul Kraus wrote: > > Interesting When I run the script on my windows box > (5.6.1) I get > > this output > > DEBUG : NON PRINT ACHAR -011747- > > DEBUG : NON PRINT ACHAR -Eco-Liner w/Att A=30-35 B=23-29cm > - DEBUG : > > NON PRINT ACHAR -139.45- > > > > Same script same

Re: Where is the new line coming from.

2003-01-16 Thread Rob Dixon
Paul Kraus wrote: > Interesting When I run the script on my windows box (5.6.1) I get > this output > DEBUG : NON PRINT ACHAR -011747- > DEBUG : NON PRINT ACHAR -Eco-Liner w/Att A=30-35 B=23-29cm - > DEBUG : NON PRINT ACHAR -139.45- > > Same script same source file run on sco o

RE: Where is the new line coming from.

2003-01-16 Thread Dan Muey
'\xd20' version, Delete any xd* and don't use the line is it's empty after that. > > > > -Original Message- > > From: Dan Muey [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, January 16, 2003 11:22 AM > > To: Paul Kraus; Perl > >

RE: Where is the new line coming from.

2003-01-16 Thread Paul Kraus
from? > -Original Message- > From: Dan Muey [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 16, 2003 11:22 AM > To: Paul Kraus; Perl > Subject: RE: Where is the new line coming from. > > > > attached is a copy of the excel file if it helps. > > I

RE: Where is the new line coming from.

2003-01-16 Thread Dan Muey
%n20 is and kill it all the way to the bank. Try that and see. Dan > > > -Original Message- > > From: Paul Kraus [mailto:[EMAIL PROTECTED]] > > Sent: Thursday, January 16, 2003 11:03 AM > > To: 'Dan Muey'; 'Perl' > > Subject: RE: Where

Re: Where is the new line coming from.

2003-01-16 Thread Rob Dixon
Paul Kraus wrote: > attached is a copy of the excel file if it helps. Paul You have CRLF at the end of the line. chomp will only remove the LF. Try s/[[:cntrl:]]$//g; instead of chomp. HTH, Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTE

RE: Where is the new line coming from.

2003-01-16 Thread Paul Kraus
attached is a copy of the excel file if it helps. > -Original Message- > From: Paul Kraus [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 16, 2003 11:03 AM > To: 'Dan Muey'; 'Perl' > Subject: RE: Where is the new line coming from. > > &

RE: Where is the new line coming from.

2003-01-16 Thread Paul Kraus
[1]->[2],$format3);# Item List $worksheet->write(1,3,$lineref->[1]->[3],$format1);# Vendor Code $lineref = \@line; while (){ chomp; @line=split /\|/,$_; $line[2]=~s/ //g; &$addline; $count++; } > -Original Message- > From: Dan Muey [mailt

RE: Where is the new line coming from.

2003-01-16 Thread Dan Muey
> any of the array elements when printed act as if they have a > new line. So it would be the last array element printed. In > the case it could be 3 but it could also be 2 or 4. Then do a froeach loop on each item in the array replacing \n's and \r's and spaces( if you want

RE: Where is the new line coming from.

2003-01-16 Thread Paul Kraus
any of the array elements when printed act as if they have a new line. So it would be the last array element printed. In the case it could be 3 but it could also be 2 or 4. > -Original Message- > From: Dan Muey [mailto:[EMAIL PROTECTED]] > Sent: Thursday, January 16, 2003 10:4

RE: Where is the new line coming from.

2003-01-16 Thread Dan Muey
> I am reading in a text file that has input similar to this. > date|data|data|data\n > > I then read the file in and using a while loop I chomp off > the new line. while (){ > chomp; > @line=split /\|/,$_; > $line[2]=~s/ //g; Do you mean $line[3] since tha

Where is the new line coming from.

2003-01-16 Thread Paul Kraus
I am reading in a text file that has input similar to this. date|data|data|data\n I then read the file in and using a while loop I chomp off the new line. while (){ chomp; @line=split /\|/,$_; $line[2]=~s/ //g; print "$_" foreach (@line); last; $count++;

RE: Spreadsheet::WriteExcel - Unix New line

2003-01-16 Thread Dan Muey
eet::WriteExcel - Unix New line > > > I wrote a script that generates an excel file. I tested it on > a windows xp pro machine and everything was ok. When I put > the script on the UNIX server and run it I get blocks on my > excel sheet where new lines occurred. How can

Spreadsheet::WriteExcel - Unix New line

2003-01-16 Thread Paul Kraus
I wrote a script that generates an excel file. I tested it on a windows xp pro machine and everything was ok. When I put the script on the UNIX server and run it I get blocks on my excel sheet where new lines occurred. How can I have the UNIX Perl write out Microsoft new line characters so that

Re: Embarassing new line char

2002-12-15 Thread John W. Krahn
lways unnecessary. > close(CAP); > > Output: > Variety Story > |Local Church > |Local Fairgrounds > |Bellys full > > Do I have to reinstall perl to get it to remove the > new line? No. > In one of my other files while writing it printed out > a square box for

Embarassing new line char

2002-12-15 Thread Patricia Hinman
lose(CAP); Output: Variety Story |Local Church |Local Fairgrounds |Bellys full Do I have to reinstall perl to get it to remove the new line? In one of my other files while writing it printed out a square box for a newline character that I was trying to remove. Has anyone had this happen? T

Re: how can i get rid of these new line characters?

2002-10-04 Thread John W. Krahn
t; i wonder how i can eliminate the new line characters within each sequence > without touching those between sequences? > > . > > 2 chr1 10761 10775 chr19 46520370 46520384 + 941 > acaGGGAACAA > acagggaaggg > > 3

RE: how can i get rid of these new line characters?

2002-10-04 Thread Bob Showalter
> -Original Message- > From: s wang [mailto:[EMAIL PROTECTED]] > Sent: Friday, October 04, 2002 11:00 AM > To: [EMAIL PROTECTED] > Subject: how can i get rid of these new line characters? > > > > i have just started writing some scripts in PERL and i am >

Re: how can i get rid of these new line characters?

2002-10-04 Thread James Edward Gray II
ish i could get some help for this >> problem. any suggestion is greatly appreciated. >> >> i have a set of files with sequences aligned in the following format. >> i wonder how i can eliminate the new line characters within each >> sequence without touching tho

Re: how can i get rid of these new line characters?

2002-10-04 Thread James Edward Gray II
t; catch a deadline, i really wish i could get some help for this > problem. any suggestion is greatly appreciated. > > i have a set of files with sequences aligned in the following format. > i wonder how i can eliminate the new line characters within each > sequence witho

Re: how can i get rid of these new line characters?

2002-10-04 Thread Jeff 'japhy' Pinyan
i >wonder how i can eliminate the new line characters within each sequence >without touching those between sequences? Heh, a much simpler way is: open DNA, "< dna.txt" or die "can't read dna.txt: $!"; open NEW_DNA, "> dna.txt.new" or die &q

Re: how can i get rid of these new line characters?

2002-10-04 Thread Jeff 'japhy' Pinyan
i >wonder how i can eliminate the new line characters within each sequence >without touching those between sequences? I think the easiest way is to read in a line, then read the next line. If the next line is NOT "\n", then remove the last character from the previous line: open

RE: how can i get rid of these new line characters?

2002-10-04 Thread nkuipers
other file. > >Hope this helps. > >Prachi. > > >Original Message Follows >From: s wang <[EMAIL PROTECTED]> >To: [EMAIL PROTECTED] >Subject: how can i get rid of these new line characters? >Date: Fri, 4 Oct 2002 08:00:19 -0700 (PDT) > > >i have just s

Re: how can i get rid of these new line characters?

2002-10-04 Thread Prachi Shah
. Original Message Follows From: s wang <[EMAIL PROTECTED]> To: [EMAIL PROTECTED] Subject: how can i get rid of these new line characters? Date: Fri, 4 Oct 2002 08:00:19 -0700 (PDT) i have just started writing some scripts in PERL and i am trying to catch a deadline, i really

how can i get rid of these new line characters?

2002-10-04 Thread s wang
i have just started writing some scripts in PERL and i am trying to catch a deadline, i really wish i could get some help for this problem. any suggestion is greatly appreciated. i have a set of files with sequences aligned in the following format. i wonder how i can eliminate the new line

RE: defining a new line seperator

2001-07-04 Thread mark crowe (JIC)
will be assigned to the next paragraph). See perldoc perlvar for a better explanation. Cheers Mark C > > $/ is the var for this, so you should say: > $/="\n\n"; > > have a nice day. > > > On Tue, 3 Jul 2001 [EMAIL PROTECTED] wrote: > > > i'd

Re: defining a new line seperator

2001-07-03 Thread Pozsar Balazs
$/ is the var for this, so you should say: $/="\n\n"; have a nice day. On Tue, 3 Jul 2001 [EMAIL PROTECTED] wrote: > i'd like to define a new line separator as a simple blank line. i have > tried \n\n and even tried ^$ in the way of a regex, but to no avail. is &g

defining a new line seperator

2001-07-03 Thread charles
i'd like to define a new line separator as a simple blank line. i have tried \n\n and even tried ^$ in the way of a regex, but to no avail. is there a metacharacter specific to this? -cjm

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 $/ = '

NEW LINE

2001-06-11 Thread arvind Bir
CAn any one suggest a pattern for checking the newline character at the end of line? Problem:Actually the requirement is that I want to read no. of lines by comparing the newline character which will tell that this is the end of paragraph? Can anyone send me the code for this or any alternati

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{^

New line in Regular expression.

2001-05-23 Thread pda
Hi, I am facing problem to serach the new line also in the regular expression. For example:-