Re: Editing a output file
Posted in 1999
From: "Stacey Windsor" <swindsor@verner.com> > >I have a SQL command that runs each night against my database to generate >an output >file, but the output is not quite right. The output format is as >follows: > >TKID | TKINIT | TKFIRST | TKLAST > >1 | RAB | Robert A. | Banks | >2 | DEC | David R.| Cunningham | >3 | MRD | Mathew R. | Donaldson | > >Is the a way to write a script, use VI or a third party program to edit >this file to remove the pipe symbol (and extra space) from between the >TKFIRST and TKLAST so that the final format looks like this: > >1 | RAB | Robert A. Banks | >2 | DEC | David R. Cunningham | >3 | MRD | Mathew R. Donaldson | There are a zillion ways of doing this under UNIX, how about cat file1 | awk '{print $1" "$2" "$3" "$4" "$5" "$6" "$8" "$9}' ? (I'm just too lazy to think of something clever... :-) ______________________________________________________ Get Your Private, Free Email at http://www.hotmail.com