0

I have a text file that was created on a windows PC that I'm then opening on a debian machine. I open it in nano and at the bottom it says (Converted from DOS format).

When I grab a single line out of the file and look at it's binary representation using:

head -n1 filename.txt | xxd -b 

It shows that two 00001101 characters have been added to the line. I'm trying to remove them with tr like this:

head -n1 filename.txt | tr -d "^]" | xxd -b 

but that doesn't seem to be working.

Any idea how I can solve this issue? To create ^] I'm doing shift + ^ then ] do I need to do something else to generate the group separator control character?

David
  • 14,569
  • 34
  • 78
  • 107

1 Answers1

0

use dos2unix utility, there are a lot of sed/perl/awk/other solutions if you do a quick search. I would be surprised if this question is not answered a couple of times already on this site.

akostadinov
  • 17,364
  • 6
  • 77
  • 85