[PLUG] Identifying character codes in an ASCII text file

Paul Heinlein heinlein at attbi.com
Thu Aug 15 16:34:10 UTC 2002


On Thu, 15 Aug 2002, Rich Shepard wrote:

> How can I identify the hex code for this character? And, how would I
> specify that code in a search-and-replace operation (in joe or
> emacs, for example)?

od is the command-line utility I typically use for such things. Try

  od -ab filename.txt | less

Then you can use perl for the search and replace:

  # replace spaces with '%'
  perl -pe 's/\055/%/g' filename.old > filename.new

--Paul Heinlein <heinlein at attbi.com>





More information about the PLUG mailing list