[SGVLUG] Help with file format

Ted Arden ted at tux.org
Wed Nov 29 08:11:27 PST 2006


sounds like the file is multi-part.  you could
try stripping off the txt bits in front, redirecting
the 'garbage bits' to another file then asking
linux to tell you what that 'garbage' is..
octal dumps are kinda fun too.

od -c ./garbage.foo | less

then you can kinda see what sorta characters are
there.

if there's any sorta texty type stuff in the
'garbage', use strings to strip it out as well.

anyway, the od stuff is olde skewl unix commands
back from my OSF/1 days.. strings sometimes works
a bit better to *read* files like that.

strings ./garbage.foo

=ted=

On Wed, 29 Nov 2006, James Neff wrote:

> Greetings,
>
> We received a file from a customer and I'm having trouble determine what
> the character set is.
>
> When I run the "file" utility:
>
> [root at appserver2 06-11-28]# file customer-file.txt
> customer-file.txt: MPEG ADTS, layer I, v1,  96 kBits, 44.1 kHz, Stereo
>
>
> When I run "less"  it thinks its a binary file and I see garbage if I
> choose to look at it anyway.
>
> When I run "vi" I can read the file just fine from start to finish but
> at the bottom of the terminal is:
>
> "customer-file.txt" [converted][dos] 47830L, 9943298C
>
> The line count is correct.
>
> When I run "more" I can read the file just fine from start to finish.
>
> When I try to use "split", the first 15103 lines look ok, but after that
> everything looks like garbage, as if its binary.
>
> Before I can go back to our customer and ask them for a proper file, I
> need to at least tell them what is wrong with this file (other than
> saying something is wrong with it).
>
> What started this problem was when we tried to import this into our MS
> SQL database using DTS.  At line 15103 the DTS reported an error saying
> there were extra columns in that record.  When we first opened DTS it
> reported the file is in UNICODE.   How would I go about verifying that?
>
> So how do I determine what exactly is wrong with this?  Any ideas?
>
> Thanks in advance,
> James
>



More information about the SGVLUG mailing list