converting 'data' to text
David Bandel
david.bandel
Mon Jun 4 20:31:53 PDT 2007
On 6/4/07, Net Llama! <netllama at linux-sxs.org> wrote:
> I've got this app which is generating output to a log file.
> Unfortunately, the log file is getting interpretted as a 'data' (when i
> run file against it), and to make matters worse, this is resulting in the
> file being treated as a binary blob of data when I email it (rather than
> plain text). However, if I open the file in more, less, vi, etc, its all
> just normal text.
>
> Anyone know of a way to convert this over to text so that it will stop
> getting handled by email clients as binary data?
The trick is in understanding file formats (man magic). Apparently,
there are one or more non-printing/control characters in the file.
However, you may be able to force recognition as a text file by
including a first line that is ASCII text (usually doesn't work) or by
using 'vi -b' to find the non-printing character.
Alternately, Bill's use of strings to read only ASCII strings to
another file will work.
In the long run, would be best to find out what the program is sending
as output and fix it if it's supposed to be ASCII text.
Ciao,
David A. Bandel
--
Focus on the dream, not the competition.
- Nemesis Air Racing Team motto
More information about the Linux-users
mailing list