[ale] One for the perl hackers

Robert L. Harris robert.l.harris at gmail.com
Thu Oct 3 18:28:18 EDT 2013


Changing ' to " or escaping the , did not help.

I just prefer perl.  I'll try for the Denver PM group, don't think it was
around the last time I looked for one, and boulder seems dead.  Thanks for
the reminder on PM.org, worst case scenario I keep looking for active
groups.

Robert



On Thu, Oct 3, 2013 at 4:08 PM, Jim Kinney <jim.kinney at gmail.com> wrote:

> Unless you have a magical way to escape the comma inside the quoted
> string, you're stuck. sed 's/\(".\+\),\(.\+"\)/\1\\,\2/g' file. Assuming
> all intermediate strings will be double quoted.
>
> Might try splitting to an array instead of individual string vars. Then
> you can do a length test to see if you got something "extra".
> @strings = split(',' , $String);
>
> Be sure to empty the array after each run or loop it as a local variable
> created each pass.
>
>
>
> On Thu, Oct 3, 2013 at 5:22 PM, Robert L. Harris <
> robert.l.harris at gmail.com> wrote:
>
>>
>> *Sorry for the OT but my only perl lists have gone dark a long time ago*
>>
>>
>> $String='component1,component2,"This is my, test string", component4';
>>
>> ($C1, $C2, $Str, $C4) = split(',', $String);
>>
>> I'm only getting "This is my" in $Str and $C4 does not contain
>> "component4".  Is there a graceful way of handling this?  It's a 1 in 10000
>> chance it'll break but accuracy counts.
>>
>> Robert
>>
>>
>> --
>> :wq!
>>
>> ---------------------------------------------------------------------------
>> Robert L. Harris
>>
>> DISCLAIMER:
>>       These are MY OPINIONS             With Dreams To Be A King,
>>        ALONE.  I speak for                      First One Should Be A Man
>>        no-one else.                                     - Manowar
>>
>> _______________________________________________
>> Ale mailing list
>> Ale at ale.org
>> http://mail.ale.org/mailman/listinfo/ale
>> See JOBS, ANNOUNCE and SCHOOLS lists at
>> http://mail.ale.org/mailman/listinfo
>>
>>
>
>
> --
> --
> James P. Kinney III
> *
> *Every time you stop a school, you will have to build a jail. What you
> gain at one end you lose at the other. It's like feeding a dog on his own
> tail. It won't fatten the dog.
> - Speech 11/23/1900 Mark Twain
> *
> http://heretothereideas.blogspot.com/
> *
>
> _______________________________________________
> Ale mailing list
> Ale at ale.org
> http://mail.ale.org/mailman/listinfo/ale
> See JOBS, ANNOUNCE and SCHOOLS lists at
> http://mail.ale.org/mailman/listinfo
>
>


-- 
:wq!
---------------------------------------------------------------------------
Robert L. Harris

DISCLAIMER:
      These are MY OPINIONS             With Dreams To Be A King,
       ALONE.  I speak for                      First One Should Be A Man
       no-one else.                                     - Manowar
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.ale.org/pipermail/ale/attachments/20131003/94f0e5e9/attachment.html>


More information about the Ale mailing list