SUM: Control characters in text

From: Jason Neil <Jason_Neil_at_citymax.co.uk>
Date: Mon, 24 Nov 1997 10:28:45 +0100

I would like to thank:

John Kohl
Phil Farrell
Tom Blinn
JF Vibert
Jom Belonis
Dan Roscigno

for speedy responses.

I left out some bits in my description that caused some confusion, like we
actually generated the files with the extra carraige return character
because the files were destined for a PC. The actual problem, as most
people pointed out, was a bug with output of more when ^^M characters are
involved. To paraphrase Dr Tom Blinn ... it doesn't handle that crap
gracefully...

Some people offered a method to strip the characters out, if anyone is
interested here it is...

You can delete those CTRL-M characters with "tr", for example,
 tr -d '\015' < infile > outfile
'\015' is the octal escape code for CTRL-M.



Thanks again for the prompt replies,



Jase.









Original question....


> Hi
>
> I'm having a bit of a wierd problem with text files potentially
containing > corruption in the form of control characters. I fairly sure
the problem > may not be the text file but the tool I'm using to view the
file, which is > *more*.
>
> The files are normally about 1900 lines long and have a ^^M on the end of
> the line. If I use a cat -v the file looks fine. I thought that cat -v
> would show up all control characters, but when I *more* the file these
> other characters come up at what looks like the same place (say 25%
through > and then later too). I've looked at many of these files through
*more* and > they all have the same problem. I'm wondering whether *more*
has some sort
> of shared memory problem or is picking up something OS level and giving
> these characters.
>
> Another thing is that the corruption I can see with more moves up if I
add > text to the begining of a file. All leading towards more craping
out. We > have also used od -c successfully on the file. The weird thing
is I can > *more* large file without the ^^M appended to each file
successfully, so I
> guess it must be some combination of factors causing the *mor*e problem
>
> So I guess what I really want to find out is if there is a known problem
> with *more*?
>
> Should cat -v see all unprintable character? (I'm fairly sure od -c
> should)
>
> Can anyone throw any light on what's going on?
>
> Thanks in advance,
>
> Jase.
Received on Mon Nov 24 1997 - 12:05:38 NZDT

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:37 NZDT