tru64-unix-managers (formerly alpha-osf-managers) (1994-2012)
 help / color / mirror / Atom feed
From: Jason Neil <Jason_Neil () citymax ! co ! uk>
To: tru64-unix-managers
Subject: SUM: Control characters in text
Date: Mon, 24 Nov 1997 09:28:45 +0000	[thread overview]
Message-ID: <96078619210641.tru64-unix-managers.marc@archive.invalid> (raw)





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.

                 reply	other threads:[~1997-11-24  9:28 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox