Expanding Acronyms in Excel or .csv [text file]

I have a need to pass a text file through a filter to expand acronyms to
their full title, is there a utility maybe UNIX that I can use to do this?

Or maybe there is a Mac app.

I’d preferably need something that is easily changeable like a text file
with a list of acronyms [separator] full or expanded title

Best wishes Peter

================================
Peter Tucker, Oxford UK email@hidden


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

At 16:19 +0100 6/8/09, Peter Tucker wrote:

I have a need to pass a text file through a filter to expand acronyms to
their full title, is there a utility maybe UNIX that I can use to do this?

Or maybe there is a Mac app.

I’d preferably need something that is easily changeable like a text file
with a list of acronyms [separator] full or expanded title

The Unix way would be ‘sed’ with a control file:

sed -f controlFile oldFile > newFile

where ‘controlFile’ is just a text file with the edits in it as:

s/ABBR1/Full text 1/g
s/ABBR2/Full text 2/g
.
.
s/ABBRn/Full text n/g

‘s’ is the ‘substitute’ command, the trailing ‘g’ means ‘global’ as
in ‘all instances in the line’. The ‘g’ isn’t needed if you’re sure
no line contains the ABBRx that’s before it more than once. Beware if
any full text contains its ABBRx because it may recurse.

You can also use
sed -i -f controlFile theFile
for in-place editing of theFile. In Terminal do
man sed
for details. This is a recent extension to ‘sed’ and I’ve not used it.

As with Unix shell commands in general, ‘controlFile’, ‘oldFile’,
‘newFile’ and ‘theFile’ can each be simple filenames or absolute or
relative pathnames.

David


David Ledger - Freelance Unix Sysadmin in the UK.
HP-UX specialist of hpUG technical user group (www.hpug.org.uk)
email@hidden
www.ivdcs.co.uk


offtopic mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options