I can't quite get the jist of what you want with the SOUR part. As you are a fellow Aussie I will post a solution for you if you post: A sample of the SOURCE file with a corresponding example of how the OUTPUT should look. Add any notes before, after but not in the SOURCE and OUTPUT.

Here is some code to do the first bit you want. You will need perl to use this. For details on getting perl see New Monks part 7. Do you want the latest version of Perl?

#!/usr/bin/perl -w use strict; my @data; # define a hash of changes to be made my %change = ( HEAL => 'NOTE Medical:', HIST => 'NOTE Biography:', EDUC => 'NOTE Educated:', RESI => 'NOTE Resided:', OCCU => 'NOTE Occupation:', ); # accept input via three mechanisms # if no file specified here: my $file = ''; # then look for a command line argument here: $file = shift @ARGV unless $file; # if we still have no file to process # enter interactive mode here: unless ($file) { print "Please enter a file to process: "; chomp($file = <>); } # get the data open (FILE, "<$file") or die "Unable to open $file: $!"; @data = <FILE>; close FILE; # make the changes for (@data) { for my $key (keys %change) { s/$key/$change{$key}/g; } } # print the changes to a new file with the same name # as the original plus a .new suffix. open (FILE, ">$file.new") or die "Unable to write $file.new: $!"; print FILE @data; close FILE; print "Munged $file no worries!\n";

cheers

tachyon

s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print


In reply to Re: Converting GEDCOM files by tachyon
in thread Converting GEDCOM files by Joes

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.