linux-c-programming.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* View hidden characters in a textfile
@ 2005-06-27 19:45 fabio
  2005-06-27 20:19 ` Håkon Hallingstad
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: fabio @ 2005-06-27 19:45 UTC (permalink / raw)
  To: linux-c-programming

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.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: View hidden characters in a textfile
  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
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Håkon Hallingstad @ 2005-06-27 20:19 UTC (permalink / raw)
  To: Linux C Programming

On Mon, Jun 27, 2005 at 12:45:09PM -0700, 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.

hexl-mode in Emacs. It shows (e.g.) a newline '\n' as '0x0a'.

Regards,
Håkon Hallingstad
-
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: View hidden characters in a textfile
  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.
  2005-06-29  5:03 ` Jeff Woods
  3 siblings, 0 replies; 5+ messages in thread
From: Luiz Fernando Capitulino @ 2005-06-27 20:39 UTC (permalink / raw)
  To: fabio; +Cc: linux-c-programming

fabio@crearium.com wrote:

> 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.

hexedit:

http://freshmeat.net/projects/hexedit/

-- 
Luiz Fernando N. Capitulino

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: View hidden characters in a textfile
  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.
  2005-06-29  5:03 ` Jeff Woods
  3 siblings, 0 replies; 5+ messages in thread
From: J. @ 2005-06-28  8:16 UTC (permalink / raw)
  To: linux-c-programming

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.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: View hidden characters in a textfile
  2005-06-27 19:45 View hidden characters in a textfile fabio
                   ` (2 preceding siblings ...)
  2005-06-28  8:16 ` J.
@ 2005-06-29  5:03 ` Jeff Woods
  3 siblings, 0 replies; 5+ messages in thread
From: Jeff Woods @ 2005-06-29  5:03 UTC (permalink / raw)
  To: fabio; +Cc: linux-c-programming

At 6/27/2005 12:45 -0700, fabio@crearium.com wrote:
>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.

less -- AKA: the opposite of more

--
Jeff Woods <kazrak+kernel@cesmail.net> 


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-06-29  5:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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.
2005-06-29  5:03 ` Jeff Woods

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).