Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 1 Feb 2004 15:30:31 +0000
From:      Daniela <dgw@liwest.at>
To:        Marty Landman <MLandman@face2interface.com>, questions@freebsd.org
Subject:   Re: OT: sed problem
Message-ID:  <200402011530.31203.dgw@liwest.at>
In-Reply-To: <6.0.0.22.0.20040131195217.01b138d8@pop.face2interface.com>
References:  <200402010138.44102.dgw@liwest.at> <6.0.0.22.0.20040131195217.01b138d8@pop.face2interface.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200402011530.31203.dgw>