From: "J." <mailing-lists@xs4all.nl>
To: linux-c-programming@vger.kernel.org
Subject: Re: View hidden characters in a textfile
Date: Tue, 28 Jun 2005 10:16:39 +0200 (CEST) [thread overview]
Message-ID: <Pine.LNX.4.21.0506281002500.573-100000@hestia> (raw)
In-Reply-To: <1492.196.40.85.4.1119901509.squirrel@www.crearium.com>
On Mon, 27 Jun 2005 fabio@crearium.com wrote:
> Hello,
>
> Anyone know a tool (or c code) that allow a programmer to see hidden
> characters like "\n" or "\t" or "\r\n" ?
>
> The command cat, tr or sed can help manipulate this character to make them
> visible but I wonder if there is a tool like a hex editor or something
> that detailed show each character that a file contain.
>
> Thanks,
>
> fabio.
The standard gnu's text-utils package features `od' .
There's also hexdump, xxd ... and a whole forest of other tools..
Possible C code, could be as basic as you want it to be..
int main(void) {
char c;
int i = 0;
while((c = getchar()) != EOF) {
printf(" \\%03o", c);
if(i++ == 8)
putchar('\n'), i = 0;
}
return 0;
}
J.
next prev parent reply other threads:[~2005-06-28 8:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-06-27 19:45 View hidden characters in a textfile fabio
2005-06-27 20:19 ` Håkon Hallingstad
2005-06-27 20:39 ` Luiz Fernando Capitulino
2005-06-28 8:16 ` J. [this message]
2005-06-29 5:03 ` Jeff Woods
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.LNX.4.21.0506281002500.573-100000@hestia \
--to=mailing-lists@xs4all.nl \
--cc=linux-c-programming@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).