split/Perl question

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: der.hans
Date:  
Subject: split/Perl question
Am 11. Nov, 2002 schw=E4tzte Mike Starke so:

> I have a colon delimited text file that I need parse thru and grab each v=

alue.
> My problem is that some values actually contain a colon. Using the code b=

elow
> is not quite enough to extract the values:
>
> while (<>) {
> @array =3D split(":", "$_");
> }
>
> I seem to recall this same problem before but can not remember
> what I did to get around this. Can anyone point me in the right
> direction?


Are there any rules as to what can or cannot appear on either side of the
colons?

Are the colons in the data fields escaped?

If they aren't escaped, you need to find a rule you can use to differentiat=
e
data colons from separator colons.

ciao,

der.hans
--=20
#  https://www.LuftHans.com/    http://www.TOLISGroup.com/
#  Stell dir vor, es ist Krieg und keiner geht hin...