[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Regular Expression Definition



At 16:20 -0800 11/6/98, Mark Yannuzzi wrote:
>I am trying to 'split' the following line:
>
><ASCII 10> YY,XX   BIN #  1-IDSXP   #  2-VGS1P   #  8-IGSO    # 10-VGF
>\n
>          ^     ^^^   ^ ^^       ^^^ ^^       ^^^ ^^      ^^^^ ^      ^^^^
>where ^ = whitespace.  I need the line to be place into the array as
>follows:
>
>[YY,XX] [BIN] [#  1-IDSXP] [#  2-VGS1P] [#  8-IGSO] [# 10-VGF]
>                ^^           ^^           ^^          ^
>so that the numerical data lines that follow will correlate (array
>index-wise) with these headers.  I have tried various combos of /s, etc.,
>but the varying whitespaces are reeking havoc.  Sometimes, I will also
>end up with the fist element of the array containing the NULL character.

Your description is a bit ambiguous.  Whitespace is defined as being one
or more spaces, tabs, etc.  Thus, you cannot have two adjacent instances
of whitespace.  Please clarify whether:

  *  any of the whitespace characters is other than a space (blank)
  *  the number of whitespace characters between the fields varies
  *  the fields are bounded within certain column positions

This will help us in assisting you.

-r

Rich Morin:          rdm@cfcl.com, +1 650-873-7841, http://www.ptf.com/~rdm
Prime Time Freeware: info@ptf.com, +1 408-433-9662, http://www.ptf.com
MacPerl: http://www.ptf.com/macperl,   http://www.ptf.com/ptf/products/MPPE
MkLinux: http://www.mklinux.apple.com, http://www.ptf.com/ptf/products/MKLP



***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch