If the only thing you want to edit in your height.txt file, you aim for Laziness and go for the following one-liner:
perl -pi.bak -e "s/'/\t/" height.txt # Win32 perl -pi.bak -e 's/\x27/\t/' height.txt # *nix
But, as I'm typing this one, I realize there's a big flaw in you scheme: What if the Name of Person1 has a single quote in it? Maybe one of the regexen below could do the trick (and fortunately, the previous one made automatically a backup of the file!)
Win32 and *nix versions perl -pi.bak -e "s/\s(\d+)'(\d+)$/\t$1\t$2/" height.txt perl -pi.bak -e 's/\s(\d+)\x27(\d+)$/\t$1\t$2/' height.txt perl -pi.bak -e "@r=split(/\t/);$r[2] =~ s/'/\t/;$_=join(qq'\t',@r)" +height.txt perl -pi.bak -e '@r=split(/\t/);$r[2] =~ s/\x27/\t/;$_=join("\t",@r)' + height.txt
The first one finds two groups of digit separated by a ' at the end of the string, and replace the ' by a tabulation character.
TMTOWTDI!
<kbd>--In reply to Re: Opening a file for reading or writing (was: Newbie)
by OeufMayo
in thread Opening a file for reading or writing (was: Newbie)
by padangboy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |