1846552 Members
2810 Online
110256 Solutions
New Discussion

Re: data file editor

 
Steve_3
Frequent Advisor

data file editor

I have a corrupted data file that i want to edit. when i do a strings on that data file i see garbages and the data i need. how can i fixed this data file.

Thanks.
steve
7 REPLIES 7
Elizabeth_2
Valued Contributor

Re: data file editor


Hi Steve!

Are you sure that the the file is actually corrupted? Is this file a binary file? I don't doubt that you are seeing strange characters, however because the strings(1) command is looking for ASCII strings if it iss run on a binary file, it is normal for some strange characters. (This is why you may also see strange characters when you do a strings on your /etc/lvmtab).

The strings command is just a way to "cheat" and see info. It leverages how strings pulls ascii characters out of unformated files.

So, the best help that I can offer is not to trust strings. If you are looking at a binary file double check that the file is actually corrupt.

Elizabeth
Steve_3
Frequent Advisor

Re: data file editor

It is a database file so when you do file {nameof file} you get data file. Is there a tool I can edit this data file?

Thanks,
steve
Elizabeth_2
Valued Contributor

Re: data file editor


Hi Steve,

I don't know much about database files- but what database are you running? Have you tried to vi the file?
Patrick Wallek
Honored Contributor

Re: data file editor

If it is a database file, I would highly recommend NOT messing with it. Binary/data files are very hard, if not impossible, to edit. With it being a database file, you really risk royally messing up the file -- even more than it is now.

My recommendation would be to try to restore the file, or possibly the whole database, from a backup.
Dan Hetzel
Honored Contributor

Re: data file editor

Steve,

As it looks to be a database data file, you shouldn't even try editing it.
The risk is that you could be facing a total data loss.

If you want to restore that file from a backup, you should restore the whole database (all files) to maintain integrity.

First of all, are you sure that this file is corrupted? Is the database complaining ? Don't trust unix because the operating system has no idea of the file formatting.

Best regards,

Dan
Everybody knows at least one thing worth sharing -- mailto:dan.hetzel@wildcroft.com
Paula J Frazer-Campbell
Honored Contributor

Re: data file editor

Steve
I only way to edit a database file is to use the database itself to edit/fix it.

Most database have inbuilt data integrety testing software.

What database does it belong to.

Paula
If you can spell SysAdmin then you is one - anon
Steve_3
Frequent Advisor

Re: data file editor

Thanks for all your advice. There is no way to edit the database file. They are planning to rebuild the database.

Thanks
steve