RootsWeb.com Mailing Lists
Total: 5/5
    1. Re: Search and replace in one field
    2. Charlie Hoffpauir
    3. On Sat, 16 Feb 2013 08:19:55 +0200, Steve Hayes <hayesstw@telkomsa.net> wrote: >On Fri, 15 Feb 2013 18:48:58 -0600, Charlie Hoffpauir <invalid@invalid.com> >wrote: <snip> >> >>If Legacy won't let you do the replacement in the given name field, >>then it gets more complicated, but still doable. In essence, you >>create the GEDCOM from Legacy with the names unchanged, then do the >>search/replace on the GEDCOM. The reason it's more difficult there is >>because then you have to write some sort of macro the do the >>replacement only on quote marks found in the name field. I did a few >>macros similar to that using Word to process the GEDCOMs generated by >>FTM back before RM wouldn't do the import directly. > >I think that is the kind of thing that AWK is designed to do fairly easily and >efficiently. > >I think if one knew enough about AWK (which I don't) one could develop quite a >lot of useful routines for the manipulation of GEDCOM files. Steve, You sparked my interest. I still try to use GEDCOM Explorer (GEDX) occasionally, so I'd like to hear more about AWK. I might have heard of it, but it's too early in the morning for me to think clearly.... What does AWK stand for?

    02/16/2013 02:04:31
    1. Re: Search and replace in one field
    2. J. Hugh Sullivan
    3. On Sat, 16 Feb 2013 09:04:31 -0600, Charlie Hoffpauir <invalid@invalid.com> wrote: >You sparked my interest. I still try to use GEDCOM Explorer (GEDX) >occasionally, so I'd like to hear more about AWK. I might have heard >of it, but it's too early in the morning for me to think clearly.... >What does AWK stand for? After talking with my friend he suggests using GREP. Are you familiar with GREP - Steve? Hugh

    02/16/2013 09:51:50
    1. Re: Search and replace in one field
    2. Ian Goddard
    3. J. Hugh Sullivan wrote: > On Sat, 16 Feb 2013 09:04:31 -0600, Charlie Hoffpauir > <invalid@invalid.com> wrote: > >> You sparked my interest. I still try to use GEDCOM Explorer (GEDX) >> occasionally, so I'd like to hear more about AWK. I might have heard >> of it, but it's too early in the morning for me to think clearly.... >> What does AWK stand for? Ahoe, Weinberger & Kernighan - its authors. > After talking with my friend he suggests using GREP. Are you familiar > with GREP - Steve? grep looks for lines containing particular strings. But it doesn't edit things. awk and sed do. The thing is that these are all Unix commands. There is a package called Cygnus which makes them available on Windows but that's really intended to make Unixers feel at homw on Windows. They're not easy to use for the uninitiated - especially awk. Here, for example, are the instructions for sed: http://unixhelp.ed.ac.uk/CGI/man-cgi?sed -- Ian The Hotmail address is my spam-bin. Real mail address is iang at austonley org uk

    02/16/2013 10:14:51
    1. Re: Search and replace in one field
    2. Steve Hayes
    3. On Sat, 16 Feb 2013 09:04:31 -0600, Charlie Hoffpauir <invalid@invalid.com> wrote: >>I think if one knew enough about AWK (which I don't) one could develop quite a >>lot of useful routines for the manipulation of GEDCOM files. > >Steve, > >You sparked my interest. I still try to use GEDCOM Explorer (GEDX) >occasionally, so I'd like to hear more about AWK. I might have heard >of it, but it's too early in the morning for me to think clearly.... >What does AWK stand for? The AWK Programming Language? Users Manual and Tutorial? ? This document is an introduction to the use of AWK for manipulating ? text and the textual representation of numbers. This mouthful means that you ? can use AWK to manipulate words and numbers. ? ? 1. Basic Concepts? ? 1.1 AWK Programs? ? AWK programs consist of a series of PATTERNS and ACTIONS. Patterns ? are boolean (logical) expressions that are evaluated and if they are true ? (non-zero number or non-null string) then the associated Action is performed. ? Actions are program fragments in a "C" like language. ? ? The Pattern-Action statements comprising an AWK program are evaluated ? in turn for each input RECORD. That is, a Record is read and the Patterns in ? the program are evaluated in order, for each Pattern that succeeds, an Action ? is performed. For example:? NR == 5 { print }? ? is a simple program that prints the fifth line of a file. NR is a built-in ? variable that is equal to the number of records AWK has read so far. The ? double equal sign is the equality comparison operator from C.? ? As you can see from the above example, a Pattern is a naked expression ? and an Action is a compound statement or list of program statements enclosed ? in braces ({}).? ? You may omit the Action in a Pattern/Action statement in which case ? the default action is { print }. You may, on the other hand omit the Pattern ? which defaults to true, so that the Action is always taken. Finally if you ? omit both the Pattern and the Action you have a blank line, which is ignored. ? ? 1.2 Fields and Records? ? To AWK all data are divided into FIELDS and RECORDS. The definition ? of a field is any string of characters separated by the Field Separator or FS ? for short. Similarly a record is any string of characters separated by the ? Record Separator or RS.? ? In the simplest form a Field is a string of characters surrounded by ? white space (blanks or tabs,) and a Record is a line of text. You can make ? the Field Separator as complex as you like by providing your own REGULAR ? EXPRESSION for the FS. The Record Separator is limited to the null string "" ? or a newline "\n". The null string means that a blank line separates a multi-? line record, and the newline means that each line is a record.? ? You can refer to the Fields in the current Record with the dollar ($) ? operator:? ? $3 < 10 { print NR, $0 }? ____________________________________ There's more than that, of course, but that should give you the general idea. AWK comes styandard with Unix, and a variant, called GAWK with Linux. I use a DOS implementation. -- 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/16/2013 02:42:46
    1. Re: Search and replace in one field
    2. Steve Hayes
    3. On Sat, 16 Feb 2013 09:04:31 -0600, Charlie Hoffpauir <invalid@invalid.com> wrote: >You sparked my interest. I still try to use GEDCOM Explorer (GEDX) >occasionally, so I'd like to hear more about AWK. I might have heard >of it, but it's too early in the morning for me to think clearly.... >What does AWK stand for? If you give me your e-mail address, I can send it to you as a ZIP file. -- 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/16/2013 11:47:51