Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!ukma!s.ms.uky.edu!neil From: neil@ms.uky.edu (Neil Greene) Newsgroups: comp.unix.questions Subject: shell script to... Keywords: sed, awk, script Message-ID: Date: 9 Apr 91 20:25:47 GMT Organization: University of Kentucky, Dept. Math Sciences Lines: 27 Any sed gurus that would like to explain how to accomplish the following. I have not masterd the art of sed or awk. I have a file that contains drug names and next to the drug name is the drug group. > Dipyrone Analgesic > Nefopam Analgesic > Thiosalicylic Acid Analgesic > Xylazine Analgesic > Chloramphenicol Antibiotic A need a shell script that will read from another (ascii) data file, find an occurance of a DRUG_NAME, write the line to another (ascii) file and append the appropriate DRUG_TYPE to the new line. # line with drug name in it xxxx 01/02/90 xxxxxx xxxxx xxx x xxxxxxx Dipyrone .... xxxx xxxxx # rewrite new line to new ascci file xxxx 01/02/90 xxxxxx xxxxx xxx x xxxxxxx Dipyrone .... xxxx xxxxx Analgesic -- Neil Greene --- University of Kentucky Mathmatics and Sciences University of Kentucky Computing Center neil@graphlab.cc.uky.edu [NeXT Attachments]