Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need to substitute Hex C7 with pipe

Status
Not open for further replies.

walmv

Programmer
Aug 1, 2003
2
US
I need to substitute all hex C7 values in a file with a pipe. I tried substituting with sed, and it doesn't seem to recognize it:

sed 's/\0xC7/|/g' test.dat
sed 's/\xC7/|/g' test.dat
and many other variations.

Any one know how I can do this?
 
Try something like this:
Code:
tr '\307' '|' <test.dat

Hope This Help
PH.
 
Thanks for the reply.

Your solution works about twice as fast as a perl on-liner someone gave me, but I lost 21 bits along the way somewhere. The size of my source file and perl solution result file were the same, but 21 bits less using the tr command above. It's a 38 meg file, so it's not like its a line feed or something.

Hmmm. Weird.

I think I'll try a diff on it and see what happened.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top