FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > CentOS > CentOS

 
 
LinkBack Thread Tools
 
Old 04-17-2008, 12:56 PM
Hiep Nguyen
 
Default exam txt file

hi all, i have centos 5 w/o gui. i can only have access via ssh.

i have a text file that contains special (unprintable) characters, what
editor i can use to exam what those character are???


i use vi, but i don't know what is ^@

may be an editor that can show ASCII as dec or hex.

thanks


_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-17-2008, 01:03 PM
Luciano Rocha
 
Default exam txt file

On Thu, Apr 17, 2008 at 05:56:36AM -0700, Hiep Nguyen wrote:
> hi all, i have centos 5 w/o gui. i can only have access via ssh.
>
> i have a text file that contains special (unprintable) characters, what
> editor i can use to exam what those character are???
>
> i use vi, but i don't know what is ^@

^@ is the nul byte (zero byte).

> may be an editor that can show ASCII as dec or hex.

xxd, included with vi, can show you the hex dump followed by the ascii
one, while hexedit allows you to edit the file either entering the
hexadecimal value or the ascii one.

Anyway, a text file with 00 is very unusual, maybe it got corrupted?

--
lfr
0/0
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-17-2008, 01:13 PM
Hiep Nguyen
 
Default exam txt file

yes, corruption indeed, but i want to study why the program writes ^@ to
this file.


t. hiep


On Thu, Apr 17, 2008 at 05:56:36AM -0700, Hiep Nguyen wrote:
> hi all, i have centos 5 w/o gui. i can only have access via ssh.
>
> i have a text file that contains special (unprintable) characters, what
> editor i can use to exam what those character are???
>
> i use vi, but i don't know what is ^@

^@ is the nul byte (zero byte).

> may be an editor that can show ASCII as dec or hex.

xxd, included with vi, can show you the hex dump followed by the ascii
one, while hexedit allows you to edit the file either entering the
hexadecimal value or the ascii one.

Anyway, a text file with 00 is very unusual, maybe it got corrupted?

--
lfr
0/0
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-17-2008, 01:31 PM
Stephen Harris
 
Default exam txt file

On Thu, Apr 17, 2008 at 06:13:40AM -0700, Hiep Nguyen wrote:
> yes, corruption indeed, but i want to study why the program writes ^@ to
> this file.

It's mostly likely not an ASCII file; it's probably UTF16 or similar
so there are two bytes for every character, but the high byte is 0x00
which shows as ^@.

If this is true then
tr -d '00' < badfile > goodfile
will most likely fix it.

--

rgds
Stephen
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-17-2008, 01:54 PM
Max Hetrick
 
Default exam txt file

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephen Harris wrote:

> It's mostly likely not an ASCII file; it's probably UTF16 or similar
> so there are two bytes for every character, but the high byte is 0x00
> which shows as ^@.


I've seen strange characters in DOS files before.

What about running dos2unix on it?

# dos2unix file.txt

Or am I thinking something else? Just a thought.

Regards,
Max
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFIB1alIXSX/6LmsXkRAmphAJ95GVATY05cfFHDOaxhDUm/DRVzkwCfcvNK
mwTZIOHZikaeyKT4YEv+4AE=
=S8kO
-----END PGP SIGNATURE-----
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-17-2008, 01:59 PM
Stephen Harris
 
Default exam txt file

On Thu, Apr 17, 2008 at 09:54:45AM -0400, Max Hetrick wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Stephen Harris wrote:
>
> > It's mostly likely not an ASCII file; it's probably UTF16 or similar
> > so there are two bytes for every character, but the high byte is 0x00
> > which shows as ^@.
>
> I've seen strange characters in DOS files before.

DOS files typically have ^M characters at the end of each line and
maybe a ^Z at the end of file. This is different to using an alternate
character set.

> What about running dos2unix on it?

The manual (at least on 4.5) doesn't specifically say it'll convert
character sets. It might drop the 00 characters as it goes. *shrug*

--

rgds
Stephen
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-17-2008, 02:02 PM
Max Hetrick
 
Default exam txt file

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephen Harris wrote:

> DOS files typically have ^M characters at the end of each line and
> maybe a ^Z at the end of file. This is different to using an alternate
> character set.

That's right. I couldn't remember what it was, it's been awhile since
I've seen it.

Well, ignore me then, sorry for the noise.

Regards,
Max

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)

iD8DBQFIB1hoIXSX/6LmsXkRAnieAKCBltAEfu6ID1t2zmaadcqwVEniTACfcqbM
bLiDZzeAJubNu/8W9/lpZ7M=
=/SGl
-----END PGP SIGNATURE-----
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-17-2008, 02:02 PM
Hiep Nguyen
 
Default exam txt file

On Thu, 17 Apr 2008, Max Hetrick wrote:


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Stephen Harris wrote:


It's mostly likely not an ASCII file; it's probably UTF16 or similar
so there are two bytes for every character, but the high byte is 0x00
which shows as ^@.



I've seen strange characters in DOS files before.

What about running dos2unix on it?

# dos2unix file.txt

Or am I thinking something else? Just a thought.

Regards,
Max
-----BEGIN PGP SIGNATURE-----


definitely not unix file, it's novell/windows thing.
_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-17-2008, 02:02 PM
"Alan Bartlett"
 
Default exam txt file

On 17/04/2008, Hiep Nguyen <hiep@ee.ucr.edu> wrote:
i have a text file that contains special (unprintable) characters, what editor i can use to exam what those character are???

i use vi, but i don't know what is ^@

may be an editor that can show ASCII as dec or hex.
How about keeping things simple to start with. Just examine a copy of the file:

hexdump -C file.txt | less

before attempting to edit/convert/correct it.


Also, how about telling us which process is writing this file (possibly corruptly)?

Alan.



_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 
Old 04-17-2008, 02:19 PM
"Ross S. W. Walker"
 
Default exam txt file

Hiep Nguyen wrote:
>
> hi all, i have centos 5 w/o gui. i can only have access via ssh.
>
> i have a text file that contains special (unprintable) characters, what
> editor i can use to exam what those character are???
>
> i use vi, but i don't know what is ^@
>
> may be an editor that can show ASCII as dec or hex.

Is 'file' able to identify it?

It may be a unicode RTF document, or an image file like TIF.

-Ross

__________________________________________________ ____________________
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.

_______________________________________________
CentOS mailing list
CentOS@centos.org
http://lists.centos.org/mailman/listinfo/centos
 

Thread Tools




All times are GMT. The time now is 05:07 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org