awk question
- From: Oliver Fromme <olli@xxxxxxxxxxxxxxxxx>
- Date: Thu, 9 Apr 2009 15:32:51 +0200 (CEST)
Len Conrad <lconrad@xxxxxxxxxxxxx> wrote:
We need to print a line when the 3rd field (with trailing ";"
delimiter) is, eg, exactly 5 lower case characters
awk ' $3 ~ /^[a-z]{5,5};$/ {print $0} ' file
... doesn't work.
If ";" is the delimiter character, you need to tell awk
about it (i.e. use the -F option). This one should work:
awk -F';' '$3 ~ /^[a-z]{5}$/ {print}' file
If that still doesn't work for you, please specify your
file format more exactly, and provide an example of the
input lines.
Best regards
Oliver
--
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing b. M.
Handelsregister: Registergericht Muenchen, HRA 74606, Geschäftsfuehrung:
secnetix Verwaltungsgesellsch. mbH, Handelsregister: Registergericht Mün-
chen, HRB 125758, Geschäftsführer: Maik Bachmann, Olaf Erb, Ralf Gebhart
FreeBSD-Dienstleistungen, -Produkte und mehr: http://www.secnetix.de/bsd
"anyone new to programming should be kept as far from C++ as
possible; actually showing the stuff should be considered a
criminal offence" -- Jacek Generowicz
_______________________________________________
freebsd-questions@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "freebsd-questions-unsubscribe@xxxxxxxxxxx"
- Follow-Ups:
- Re: awk question
- From: Polytropon
- Re: awk question
- References:
- (no subject)
- From: Len Conrad
- (no subject)
- Prev by Date: Re: new package system proposal
- Next by Date: Re: cannot kill process with kill -9
- Previous by thread: awk field (was Re: (no subject))
- Next by thread: Re: awk question
- Index(es):
Relevant Pages
|