[EMAIL PROTECTED] wrote:
>
> On Apr 26, 9:55 am, [EMAIL PROTECTED] (Rob Dixon) wrote:
>>
>> [EMAIL PROTECTED] wrote:
>>>
>>> The following script is to read 4 consecutive lines at a time from a
>>> file, concatenate the first 3 lines
>>> (with a ", "), and print the result to STDOUT. If the 3 lin
On Sat, Apr 26, 2008 at 3:42 PM, <[EMAIL PROTECTED]> wrote:
> I tried your suggestion and got the following output:
> 1) the first col didn't print, and the 3rd col overwrote the 2nd; this
> is the main stumbling block
> 2) also, what if example.txt has 36 lines with the same format as
> descr
I tried your suggestion and got the following output:
1) the first col didn't print, and the 3rd col overwrote the 2nd; this
is the main stumbling block
2) also, what if example.txt has 36 lines with the same format as
described.
FYI I'm using cgywin's version of perl.
--
On Apr 26, 9:55 am, [EMAI
[EMAIL PROTECTED] wrote:
> The following script is to read 4 consecutive lines at a time from a
> file, concatenate the first 3 lines
> (with a ", "), and print the result to STDOUT. If the 3 lines aren't
> concatenated they print correctly, however
> if they are, the result is gibberish. Any sug
[EMAIL PROTECTED] wrote:
The following script is to read 4 consecutive lines at a time from a
file, concatenate the first 3 lines
(with a ", "), and print the result to STDOUT. If the 3 lines aren't
concatenated they print correctly, however
if they are, the result is gibberish. Any suggestions
John W. Krahn wrote:
M. Lewis wrote:
I now we can push (concatenate) data onto an array.
I would assume that we could concatenate data on to a string as well
with something like:
$newstring = $oldstring . $newdata
Yes.
Maybe this isn't correct though. I've not yet tried it.
My question is
To push something to an array:
push(@array, $data);
To push something onto a scalar:
$scalar = $scalar . $data;
-or-
$scalar .= $data;
The better method depends entirely on what you intend to do with the
data and how you have it. It is also very easy to both split a string
into an array,
@arr
M. Lewis wrote:
>
> I now we can push (concatenate) data onto an array.
>
> I would assume that we could concatenate data on to a string as well
> with something like:
>
> $newstring = $oldstring . $newdata
Yes.
> Maybe this isn't correct though. I've not yet tried it.
>
> My question is one
From: Gunnar Hjalmarsson <[EMAIL PROTECTED]>
> Charlene Gentle wrote:
> > I need a example of how to receive a string (after someone entered a
> > name for a txt file into a tk-box). It has to do the following :
> >
> > 1. Send the string to a sub
> > 2. The sub should save the txt file for later
Charlene Gentle wrote:
I need a example of how to receive a string (after someone entered
a name for a txt file into a tk-box). It has to do the following :
1. Send the string to a sub
2. The sub should save the txt file for later use.
3. The file should show in a message box that it has been save
[EMAIL PROTECTED] wrote:
>
> Is there a simple way to reject any string that has extended characters in
> it? In other words, only accept the 88 (I think it's 88) regular keyboard
> characters and numbers. I can't find a simple way to do this.
if ( $string =~ /[^[:print:]]/ ) {
print "This st
[EMAIL PROTECTED] wrote:
Is there a simple way to reject any string that has extended characters in
it? In other words, only accept the 88 (I think it's 88) regular keyboard
characters and numbers. I can't find a simple way to do this.
Does this help?
if($string !~ m/^\w+$/) { die "I hate ex
Jim
Please send two sample strings one that contains 'reject'able stuff, and other with
those 88. That would clarify us better.
Jay
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Thursday, April 01, 2004 9:58 AM
To: [EMAIL PROTECTED]
Subject: Strings with extend
--As of Thursday, April 1, 2004 9:58 AM -0500, [EMAIL PROTECTED] is
alleged to have said:
Is there a simple way to reject any string that has extended characters
in it? In other words, only accept the 88 (I think it's 88) regular
keyboard characters and numbers. I can't find a simple way to do
Jerry Preston wrote:
>
> I know how to do this in C, but how to in Perl? I want to chop the
> following string:
>
>if ((bulk>0) || (sub>0)||(chuckcon>0)) conpin (smu3, bulk, sub, chuckcon,
> 0);
>
> Apart so that all is left is:
>
>if ((bulk>0) || (sub>0)||(chuckcon>0))
>
> The key word to
Mark Goland wrote:
> Rob,
> Thanks, this is a very clever solution. I will merge be murging files
> [ excel spread sheets saved in csv ], first line of files display's fileds.
> All files have same fields, but in different orders. Doe's anyone know of a
> way I can automate converssions of exc
v ??
Mark
- Original Message -
From: "Rob Dixon" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 13, 2004 7:26 AM
Subject: Re: strings
> Mark Goland wrote:
> >
> > I have a tring which contains 60 to 80 keywords, I need to know what
p
Mark Goland wrote:
>
> I have a tring which contains 60 to 80 keywords, I need to know what position a
> keyword is in. I need an efficint way to extra position of key words, here is
> how I am currently finding positions,
>
> $string="type,model,color,date";
>
> # this is how I am currently gettin
> -Original Message-
> From: Mark Goland [mailto:[EMAIL PROTECTED]
> Sent: Friday, February 13, 2004 1:28 PM
> To: [EMAIL PROTECTED]
> Subject: strings
>
>
> Hi All,
>
> I have a tring which contains 60 to 80 keywords, I need to
> know what position a keyword is in. I need an efficint
On Sat, Jun 14, 2003 at 08:56:21AM -0500 deborah wrote:
> How does Perl interpret a string when used in a numeric comparison
> equation?
It depends.
> I accidently used a numeric comparison operator when I was comparing
> strings and I found that no matter what strings I compared, Perl always
Deborah wrote:
>
> How does Perl interpret a string when used in a numeric comparison
> equation?
> I accidently used a numeric comparison operator when I was comparing
> strings and I found that no matter what strings I compared, Perl always
> said they were equal.
>
> Any other operation (suc
21 matches
Mail list logo