Usenet comp.unix.osf.misc (1992-2004)
 help / color / mirror / Atom feed
From: Doug Chapman USG <please.dont.send.mail@just.post.to.news>
Subject: Re: Awk
Date: 1998/11/20	[thread overview]
Message-ID: <3655CAFF.CF917D4B@just.post.to.news> (raw)
In-Reply-To: 3655C507.A24DEC49@just.post.to.news

Doug Chapman USG wrote:
> >
> > for example a string : 'thisisastring'  where I want the first four
> > characters : this.
> >
> 
> Sed works nicely:
> 
>         echo thisisastring | sed 's/\(....\).*/\1/'
> 


Sorry to followup to my own post but I guess it can
be done easily with awk:

	echo thisisastring | awk '{printf ("%.4s\n",$1)}'



- Doug



  reply	other threads:[~1998-11-20  5:00 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-20  5:00 Awk GJH
1998-11-20  5:00 ` Awk Doug Chapman USG
1998-11-20  5:00   ` Doug Chapman USG [this message]
1998-11-22  5:00     ` Awk Nikola Milutinovic
1998-11-20  5:00 ` Awk Nikola Milutinovic
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox