Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!sjsca4!linus!getafix!oneill From: oneill@getafix.slcs.slb.com (Dennis O'Neill) Newsgroups: comp.unix.questions Subject: awk Question Keywords: awk Message-ID: <3384@linus.SLCS.SLB.COM> Date: 8 Jan 90 15:53:49 GMT Sender: news@linus.SLCS.SLB.COM Distribution: usa Lines: 38 I'm trying to use awk to convert a LaTeX file of mailing address to something more acceptable to Oracle's bulk data loading facility. Each entry in the file is a macro for a particular location in the form of \def\slny{Schlumberger Limited\\ 277 Park Avenue\\ New York, NY 10172-0266} Successive addresses are separated by blank lines; so I'm trying something like BEGIN{ FS = "\\" RS = "" ORS = "\n\n" } $2 ~ /def/ {gsub(/\\\\/, ""); print $3 $4 $5 $6 $7 $8 $9 $10} And I get awk: syntax error near line 8 awk: illegal statement near line 8 It seems it doesn't like the gsub call. So I tried a test with just {gsub(/\\\\/, ""); print $0} and get essentially the same message: awk: syntax error near line 1 awk: illegal statement near line 1 In fact, regardless of what I use for the first argument to gsub, I get the same error. What am I doing wrong? Thanks in advance, Dennis O'Neill