Code Comments
Programming Forum and web based access to our favorite programming groups.On 2 Nov 2004 20:00:08 -0800, moggces
<juihuahsieh@nhri.org.tw> wrote:
> Sorry
> I am not sure what was wrong.
>
> I have a file which has two pattern
>
> 5673058-
> AE-848/14271200-
>
> in command line I typed: awk '/^[0-9]/ { print }' file , tried to get
> "5673058-" but it printed nothing so I tried to type awk --re-interval
> '/[0-9]{7}/ { print}' file strangely, it didn't print "5673058-" but
> instead it printed "AE-848/14271200-"
>
Perhaps the file contains a CR character, so that it prints
"AE-848/14271200-" on top of "5673058-".
--
Of course power tools and alcohol don't mix. Everyone knows power
tools aren't soluble in alcohol...
-- Crazy Nigel
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.