Find the answer to your Linux question:
Results 1 to 3 of 3
Hi, I have a destroyed xml file and would like to recover it. Do you know any linux command or script that you do it? An example of my file ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2012
    Posts
    58

    Recover xml tags


    Hi,

    I have a destroyed xml file and would like to recover it. Do you know any linux command or script that you do it?
    An example of my file is:

    Code:
    Hello </a>world<a>
    And would like to change to:

    Code:
    Hello <a>world</a>

    Thanks

  2. #2
    Linux Engineer
    Join Date
    Dec 2013
    Posts
    1,462
    It's nearly impossible task to programmatically fix a broken XML file, and even more so with HTML, though HTML is more forgiving of errors. If you have one FU'd file you'll spend less time doing it manually then searching for an easier way.

    The developer features of your favorite browser may help you find all the errors.

  3. #3
    Just Joined!
    Join Date
    Apr 2012
    Posts
    58
    Hi,

    Thank you for your reply. I know that it is difficult to recover a destroyed file. In my case, it is not an HTML document. It is a txt file that contains sentences and each sentence contains those kind of tags. Sometimes, the result is not correct, so I need to reorder them.

    I will try to find another solution, probably using sed or awk commands.

    Thanks!

  4. $spacer_open
    $spacer_close

Posting Permissions

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