karthikeyan wrote:
> Dear Bill,
> 
>   That didn't work out.  Ok I storing the output of the command in a
> variable so that it could be easy for you to manipulate.
> 
> $line = "Using ClearCommerce SSL Java API Version: release-3-8-3-17
> Shipping: 10.0 Tax: 0.0 Time - Sat Jun 22:28:42 2002
> Ref# - 12345678
> Appr - APPROVED
> Code - 123456
> AVSCode -
> PayServ -
> Err  -
> Ord# - 12.45.92.15-1024748922-901932-1575-14
> ESD0: Could not create URL.";
> 
> Actually in the string there is no new line only spaces which separate one
> pair from another and key and value are separated once by ":" and others by
> "-".
> 
>   How do i go about this job.

You need to find the line endings first.  How did you acquire the
data in the first place ?  There should be newlines in there somewhere.
Try dumping the data in hex and see if maybe you have \r's instead of
\r\n's.

If there really are no line endings, you could search for the first :
(preceded by a non-digit) or - (surrounded by WS) and then pick up the
stuff between there and the next one as the value (minuse the last word
found).

I don't have the time right now to play with it.

-- 
   ,-/-  __      _  _         $Bill Luebkert   ICQ=162126130
  (_/   /  )    // //       DBE Collectibles   Mailto:[EMAIL PROTECTED]
   / ) /--<  o // //      http://dbecoll.tripod.com/ (Free site for Perl)
-/-' /___/_<_</_</_     Castle of Medieval Myth & Magic http://www.todbe.com/

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to