<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1">
<title></title>
Jay,<br>
<br>
That does look more efficient. I will try it as well.<br>
<br>
I actual changed the sed line to: sed 's/~@//g' < $1.ul > $1.sed<br>
<pre wrap="">Each line ends with ~@~crnl (carriage-return line-feed), so when I remove the ~@ it leaves the ~.
I use it as my end-of-record marker and use an import of: import ascii merge = (filename) r=~ f=|
This works fine.
Richard D. Williams
</pre>
<br>
Jay R. Ashworth wrote:<br>
<blockquote type="cite" cite="mid20040707112820.B21185@cgi.jachomes.com">
<pre wrap="">On Wed, Jul 07, 2004 at 10:20:51AM -0500, Richard D. Williams wrote:
</pre>
<blockquote type="cite">
<pre wrap=""> Thanks to all and a special thanks to Ted Dodd.
Here is what I ended up doing.
# remove any nul
tr -d '\000' < $1 > $1.nul
# remove any ~
sed 's/~//g' < $1.nul > $1.sed
#remove any carriage-returns
tr -d '\r' < $1.sed > $1.ncr
#remove any line feeds
tr -d '\n' < $1.ncr > $1.new
#clean up
rm $1.nul $1.sed $1.ncr
#move result to my working area to be imported
mv $1.new /appl/servefx/shared/working
</pre>
</blockquote>
<pre wrap=""><!---->
That's easier to read, certainly... but it's probably more efficient to
do it as a pipeline:
cat $1 |
tr -d '\000' |
sed 's/~//g' |
tr -d '\r' |
tr -d '\n' |
cat >/appl/servefx/shared/working/$1
But, fwiw -- I assume you're bringing this in as a fixed length alien
file -- I've found in the past that it's quite a bit easier to just put
CRLF,2,*
at the end of my maps (or at the very least, LF,1,*), and leave the
intermediate file in a format I can edit comfortably with vi.
Wait: you're stripping random nulls & tildes, which means you *can't* be in
fixed-length mode: how are you coping if you yank the linefeed, too?
Cheers,
-- jra
</pre>
</blockquote>
</body>
</html>