Wednesday, January 29
Google Search: grokosaurus You might be better off starting with, say, wp2latex rather than using strip to get at the text. I'm assuming from your use of tcsh that you're on a Unix system. Normally, awk delimits records using lf under Unix, so cr will be the last character on each record which has a cr/lf. You could deal with this a few ways. For instance, you could examine the last character using substr(): { if (substr($0, length($0) - 1) == "\r") { print substr($0, 1, length($0) - 1) "
\r" } else print } or you could make cr be the field separator, and test to see if the last field on the line is empty, and if so stick
into the preceding field: BEGIN { FS = OFS = "\r" } NF > 1 && $NF == "" { $(NF-1) = $(NF-1) "
" } { print } --