parsing-bash shell-awk

Hi People:

Could anybody tell me how can I do this with awk or bash shell?
I've a file with this systaxis:

#cat file
I went fishing for some sea <bass>.
The <bass> part of the song is very moving.
he proposed an elaborate <program> of public works.This information
was taken from the magazine.
the <program> required several hundred lines of code.


I need a script that gets 3 previus words and 3 words after the
tag(<>) from a text file,EXCEPT the words greater than 2 chars
length(example of,a,an).

Returning something like this:

#cat results
for some sea bass
The bass part the song
proprosed elaborate program public works
the program required several hundred

Thanks!
-ric
ric [ Mo, 07 April 2008 18:24 ] [ ID #1936902 ]

Re: parsing-bash shell-awk

ric <ricardo7 [at] gmail.com> writes:

> Hi People:
>
> Could anybody tell me how can I do this with awk or bash shell?

That's a good homework assignment!
Maxwell Lol [ Mo, 07 April 2008 23:01 ] [ ID #1936909 ]

Re: parsing-bash shell-awk

On 7 abr, 15:01, Maxwell Lol <nos... [at] com.invalid> wrote:
> ric <ricar... [at] gmail.com> writes:
> > Hi People:
>
> > Could anybody tell me how can I do this with awk or bash shell?
>
> That's a good homework assignment!

hehe, Well, I'm trying to probe it' can be done with unix/linux :)
ric [ Mo, 07 April 2008 23:18 ] [ ID #1936910 ]

Re: parsing-bash shell-awk

In article
<cf3e1b60-dd55-4e34-ab45-c8d715b03517 [at] 8g2000hse.googlegroups.com>,
ric <ricardo7 [at] gmail.com> wrote:

> On 7 abr, 15:01, Maxwell Lol <nos... [at] com.invalid> wrote:
> > ric <ricar... [at] gmail.com> writes:
> > > Hi People:
> >
> > > Could anybody tell me how can I do this with awk or bash shell?
> >
> > That's a good homework assignment!
>
> hehe, Well, I'm trying to probe it' can be done with unix/linux :)

"probe"? Do you mean "prove"?

It should be pretty easy using awk or perl.

--
Barry Margolin, barmar [at] alum.mit.edu
Arlington, MA
*** PLEASE don't copy me on replies, I'll read them in the group ***
Barry Margolin [ Di, 08 April 2008 04:06 ] [ ID #1937596 ]

Re: parsing-bash shell-awk

On Apr 7, 8:06 pm, Barry Margolin <bar... [at] alum.mit.edu> wrote:
> In article
> <cf3e1b60-dd55-4e34-ab45-c8d715b03... [at] 8g2000hse.googlegroups.com>,
>
> ric <ricar... [at] gmail.com> wrote:
> > On 7 abr, 15:01, Maxwell Lol <nos... [at] com.invalid> wrote:
> > > ric <ricar... [at] gmail.com> writes:
> > > > Hi People:
>
> > > > Could anybody tell me how can I do this with awk or bash shell?
>
> > > That's a good homework assignment!
>
> > hehe, Well, I'm trying to probe it' can be done with unix/linux :)
>
> "probe"? Do you mean "prove"?
>
> It should be pretty easy using awk or perl.
>
> --
> Barry Margolin, bar... [at] alum.mit.edu
> Arlington, MA
> *** PLEASE don't copy me on replies, I'll read them in the group ***


yes,i'll try with awk.

Thanks for all people :)
ric [ Di, 08 April 2008 04:33 ] [ ID #1937599 ]
Linux » comp.unix.shell » parsing-bash shell-awk

Vorheriges Thema: finding and copying the files to another location
Nächstes Thema: spliting a string.