Results 1 to 5 of 5

Thread: Remove NULL-values in .txt document

  1. #1
    Just burned his ISO
    Join Date
    Dec 2008
    Posts
    9

    Default Remove NULL-values in .txt document

    Hi, i have a .txt document which is full of NULL-values, between every character there is a NULL. Is there any way of deleting only the NULL-values?

  2. #2
    Moderator KMDave's Avatar
    Join Date
    Jan 2010
    Posts
    2,281

    Default

    You mean like a blank space?

    Just use sed or vi's search and replace function.
    Tiocfaidh ár lá

  3. #3
    Just burned his ISO
    Join Date
    Dec 2008
    Posts
    9

    Default

    Yes ive thought f the find and replace function but the thing is, i dont know how to add the value NULL. Its not space or anything, when i open it in notepad+ or even notepad, NULL is a black box that says NULL.

  4. #4

    Default

    In unix, try this: tr -d '\000' < origfile.txt >newfile.txt

    "tr" is used to translate characters. Should work. I've also heard that if you just open the file in vi and then wq! (write-quit) the file, the nul characters will be removed, although I haven't tried this myself. Finally, you could try, again in Unix, dos2unix which will remove dos based characters such as CR\LF. Not sure if dos2unix removes nul characters, but it can't hurt to try.

    Good Luck...

  5. #5
    Just burned his ISO
    Join Date
    Dec 2008
    Posts
    9

    Default

    Thank you for your answers, i ended up creating a macro i windows that used backspace and the arrows to erase every NULL.

    Ill try your sugestion next time.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •