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
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
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;
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
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
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
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
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;";
$
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(/#.*
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
-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]&
[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
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
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
-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
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
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
> 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
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
&
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
(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'
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
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
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
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 d
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
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
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,
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
> 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
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
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
-- 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
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 $!;
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
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 w
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
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
> >
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 '\
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 '\'
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
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
> 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
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
'\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
> >
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
%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
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
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.
>
>
&
[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
> 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
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
> 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
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++;
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
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
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
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
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
> -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
>
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
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
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
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
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
.
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
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
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
$/ 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
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
> 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 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
> 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{^
Hi,
I am facing problem to serach the new line also in the regular expression.
For example:-
84 matches
Mail list logo