OT: sed problem
Daniela
dgw at liwest.at
Sun Feb 1 06:36:23 PST 2004
On Sunday 01 February 2004 00:58, Marty Landman wrote:
> At 08:38 PM 1/31/2004, Daniela wrote:
> >I was wondering how I can do the following with sed (or another program):
>
> How's Perl, Daniela?
>
> >1. Output only the text from the start of the line to the first pipe
> > character
>
> $out = ($line =~ /^([^\|]+)/);
>
> >2. Output only the text between the last and the previous pipe character
>
> $out = ($line =~ /\|([^\|]+)|/);
>
> >Or, split the line at the pipe characters and assign the parts to
> >different shell variables.
>
> my @ary = split '|', $line;
Looks fine, but does Perl support multi-dimensional arrays?
> These are untested but probably pretty close at least. Sorry, I haven't
> gotten to shell scripting yet so I think in terms of Perl.
>
> Marty Landman Face 2 Interface Inc 845-679-9387
> This Month's New Quiz --- Past Superbowl Winners
> Make a Website: http://face2interface.com/Home/Demo.shtml
More information about the freebsd-questions
mailing list