On Tue, Sep 16, 2003 at 02:15:23PM -0600, np wrote:
> I'm working at a used bookstore, running a fairly archaic cataloguing 
> program which runs on an IBM AIX server (Windows machines telnet in to 
> catalogue, run point of sale, etc.) All databases are exported in 
> tab-delimited text format, with whatever fields you have specified to 
> export -- all standard issue stuff. We're beginning to upload our inventory 
> to websites, and we need to do a little tweaking to the exported database 
> file before we upload -- basically, we need to replace the terse condition 
> descriptions we have on the database (limited to 8 characters!) with rather 
> more descriptive versions for online browsers.. 
> 
> So I need to write a script which does a search and replace (ex. search for 
> 'NEW', replace with 'In new condition, with no blemishes," etc..) 
> Unfortunately I'm pretty much a newbie when it comes to scripting - I've 
> done some C, some (very minor) Bash scripting, but no Korn shell scripting 
> at all. Could anyone offer any help in how to solve this problem? If 
> someone could just point out a couple of commands (I'm looking into sed and 
> awk, but not sure if this is the best place to start), I'll happily read 
> the man pages -- I'd just like to get some tips on where to look first! 
> 

One possible solution:

 perl -pi.bak -e 's/NEW/In new condition, with no blemishes/' file1 file2 ...

-- 
trammell at el-swifto.com  9EC7 BC6D E688 A184 9F58  FD4C 2C12 CC14 8ABA 36F5
Twin Cities Linux Users Group (TCLUG)      Minneapolis/St. Paul, Minnesota

_______________________________________________
TCLUG Mailing List - Minneapolis/St. Paul, Minnesota
http://www.mn-linux.org tclug-list at mn-linux.org
https://mailman.real-time.com/mailman/listinfo/tclug-list