juo has asked for the wisdom of the Perl Monks concerning the following question:
I have been looking to split a line using multiple conditions but have failed to do so. Anybody has an idea.
FDR [62.10060.051-F] [62.10051.381] 0 1 0
For example I want to split the above on space but if I have brackets it should take the whole string and ignore spaces within the bracket area. So in total I want to have six fields. I would like to do this in one split line.
# This can only work untill the first bracket my @feeder_line = split/\s+\[/;
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Split using multiple conditions
by bart (Canon) on Jun 11, 2005 at 11:31 UTC | |
Re: Split using multiple conditions
by mda2 (Hermit) on Jun 11, 2005 at 15:09 UTC | |
Re: Split using multiple conditions
by ikegami (Patriarch) on Jun 11, 2005 at 16:15 UTC | |
Re: Split using multiple conditions
by dws (Chancellor) on Jun 11, 2005 at 21:29 UTC | |
by kaif (Friar) on Jun 13, 2005 at 01:56 UTC |
Back to
Seekers of Perl Wisdom