RootsWeb.com Mailing Lists
Total: 2/2
    1. Re: Using AWK to manipulate GEDCOM files
    2. Janis Papanagnou
    3. On 20.02.2013 07:05, Steve Hayes wrote: > On Tue, 19 Feb 2013 14:06:25 +0100, Janis Papanagnou > <janis_papanagnou@hotmail.com> wrote: > [...] >> >> awk '$2 !~ /@.*@/ { sub(/Service/, "S.") } { print $0 }' > > I substituted "Ellwood1.ged" for "!~" and got this: What did you intend to do? > > gawk: (FILENAME=ellwood1.ged FNR=40697) fatal: cannot open file `/@.*@/' for > reading (Invalid argument) The !~ is an operator which is to be read as "does not match". var ~ /pattern/ # var matches pattern var !~ /pattern/ # var doesn't match pattern var == "string" # var equals string var != "string" # var doesn't equal string > > Please forgive my ignorance -- I'm still feeling my way in the dark with this > stuff. Feel free to ask. There's also Arnold's very fine book about gawk available online: http://www.gnu.org/software/gawk/manual/gawk.html Janis

    02/20/2013 01:41:54
    1. Re: Using AWK to manipulate GEDCOM files
    2. Steve Hayes
    3. On Wed, 20 Feb 2013 08:41:54 +0100, Janis Papanagnou <janis_papanagnou@hotmail.com> wrote: >On 20.02.2013 07:05, Steve Hayes wrote: >> On Tue, 19 Feb 2013 14:06:25 +0100, Janis Papanagnou >> <janis_papanagnou@hotmail.com> wrote: >> >[...] >>> >>> awk '$2 !~ /@.*@/ { sub(/Service/, "S.") } { print $0 }' >> >> I substituted "Ellwood1.ged" for "!~" and got this: > >What did you intend to do? See what happened when I ran it on a file. I'll play with it some more. -- Steve Hayes from Tshwane, South Africa Blog: http://khanya.wordpress.com E-mail - see web page, or parse: shayes at dunelm full stop org full stop uk

    02/20/2013 03:25:01