How to strip A NEWLINE
Don Bolton
lugnut at sequent.UUCP
Sat Dec 1 08:00:41 AEST 1990
In article <25665 at uflorida.cis.ufl.EDU> bjs at reef.cis.ufl.edu (Brian J. Smith) writes:
>
>When TFM fails, when all the books I have fail, I run to netland.
>
>I have searched high and low for the answer on how to strip a NEWLINE
>charactor from a file. Well not really a NEWLINE char, but a ":\\\n"
>(colon,back-slash,newline). I have tried useing sed with:
>
> sed 's/:\\\n//' file
>
>and using the RS variable in awk, but to no avail. sed will remove
>the colon and the back-slash, but not the newline.
>
>Here is the section of code that I am playing with.
Not taking time to play with it but.
a printf statement in awk will not input a newline unless you specify
one.
{ printf("%s|%s|%s|%s|%s|%s ", $1, $2, $3, $4, $5, $6) }
(assuming you want the pipe char as a seperator)
>
>#
>ps301d|bigps|qms|QMS-2210 in E301D:\
> :lp=/dev/ttyb:sd=/var/spool/ps301d:\
> :af=/var/adm/ps301d.acct:lf=/var/spool/ps301d/errs:\
> :br#9600:rw:fc#0000374:fs#0000003:xc#0:xs#0040040:\
> :mx#0:rg=printer:sf:sh:\
> :if=/local/lib/ps/psif:of=/local/lib/ps/psof:\
> :cf=/cis/reef/wp42/bin/wplpr:df=/local/lib/ps/psdf:\
> :gf=/local/lib/ps/psgf:nf=/local/lib/ps/psnf:\
> :rf=/local/lib/ps/psrf:tf=/local/lib/ps/pstf:\
> :vf=/local/lib/ps/psvf:
>#
>
>This is what I want the file to look like after the (colon,back-slash,newline)
>has been striped. As you can see what I really want is to strip a
>(colon,back-slash,newline,tab), but if someone could just get rid of that
>darn newline for me I would be *very* happy.
>
>#
>ps301d|bigps|qms|QMS-2210 in E301D:lp=/dev/ttyb:sd=/var/spool/ps301d:af=/var/adm/ps301d.acct:lf=/var/spool/ps301d/errs:br#9600:rw:fc#0000374:fs#0000003:xc#0:xs#0040040:mx#0:rg=printer:sf:sh:if=/local/lib/ps/psif:of=/local/lib/ps/psof:cf=/cis/reef/wp42/bin/wplpr:df=/local/lib/ps/psdf:gf=/local/lib/ps/psgf:nf=/local/lib/ps/psnf:rf=/local/lib/ps/psrf:tf=/local/lib/ps/pstf:vf=/local/lib/ps/psvf:
>#
>
>I know that perl can most likely solve this probelm nicely, so I am willing to
>hear of any responses, but for standardaztion I would like to use only standard
>unix filters. Sorry Larry.
>--
>Brian J. Smith Work: 904-392-1183
>CIS Sys Admin Staff 301 CSE Building
>bjs at cis.ufl.edu Univ of Florida, 32612
More information about the Comp.unix.shell
mailing list