Saving to csv caused data loss in ods file

Discuss the spreadsheet application
Post Reply
waynec444
Posts: 84
Joined: Wed Jan 21, 2015 6:09 am

Saving to csv caused data loss in ods file

Post by waynec444 »

I decided to save the file info in csv format to be able to import into a database program for reference.

After doing so I opened the ods file again and found about two hours worth of data I had entered this morning was gone.

My main question is why did this happen? It had been saved every 5 minutes and then manually saved again before creating a csv file.

I resolved my lost data problem by importing the csv file into a new ods file. However, now the display font size (75%) is smaller than the 75% in the old file. And 100% is too large. How do I get the old 75% size back?
Open Office 4.1.10 on Windows Vista
User avatar
Hagar Delest
Moderator
Posts: 32627
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Saving to csv caused data loss in ods file

Post by Hagar Delest »

CSV is a mere text format containing only raw data. Thus no formula, no formatting information and so on. You should have kept your data in a .ods file and export when necessary to any other kind of format suitable for the transfer.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31269
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Saving to csv caused data loss in ods file

Post by Villeroy »

What kind of database? Is a Base document connected to the database? Then you would not need any csv files.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
waynec444
Posts: 84
Joined: Wed Jan 21, 2015 6:09 am

Re: Saving to csv caused data loss in ods file

Post by waynec444 »

As I stated, I saved the ods file every 5 minutes AND saved it manually before saving a csv file.

Then, when opening the ods file again all data entered today was gone. How can this be?
Open Office 4.1.10 on Windows Vista
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Saving to csv caused data loss in ods file

Post by John_Ha »

waynec444 wrote:As I stated, I saved the ods file every 5 minutes AND saved it manually before saving a csv file.

Then, when opening the ods file again all data entered today was gone. How can this be?
User error.

Either you did it properly in which case everything is there when you open the .ods file; or you made a mistake, and re-opened the .csv file, in which case all formatting, formulae etc were gone.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
waynec444
Posts: 84
Joined: Wed Jan 21, 2015 6:09 am

Re: Saving to csv caused data loss in ods file

Post by waynec444 »

I will start over.

I was saving the file automatically every 5 minutes while entering data. Then before I saved as a cav file I saved it (in the ods file) manually.

Then I saved a csv file.

When reopening the ods file I found all the data entered today was gone (about 2 hours of work).

I resolved the issue by importing the csv file into a new ods file.

But WHY was a significant amount of data gone in the original ods file?

I did NOT make a mistake.
Open Office 4.1.10 on Windows Vista
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Saving to csv caused data loss in ods file

Post by RoryOF »

How did you reopen the file? Off the Recent Documents list?
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
User avatar
Hagar Delest
Moderator
Posts: 32627
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Saving to csv caused data loss in ods file

Post by Hagar Delest »

OK, I see.
Had you the backup copy activated in the Tools > Options > Load/Save > General section?
If so, you may have copies in the /backup folder of your user profile (see [Tutorial] The OpenOffice user profile).

Since I started using OOo/AOO, I experienced that twice. Don't know exactly what happened.
LibreOffice has revamped the code for file handling and it may be more robust for that.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
User avatar
RoryOF
Moderator
Posts: 34586
Joined: Sat Jan 31, 2009 9:30 pm
Location: Ireland

Re: Saving to csv caused data loss in ods file

Post by RoryOF »

There are some reports of such reverting behaviour - one such is at
https://www.sevenforums.com/microsoft-o ... rsion.html
Apache OpenOffice 4.1.15 on Xubuntu 22.04.4 LTS
John_Ha
Volunteer
Posts: 9583
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Saving to csv caused data loss in ods file

Post by John_Ha »

There is no way in which a file can lose "the data I entered today". When you consider the file structure - data encoded in xml tags and then placed in a zip container - it is just not possible. A corrupted file typically has corrupted xml tags or binary corruotion in the zip container.

Look to user error - you did not do what you are telling us you did.
LO 6.4.4.2, Windows 10 Home 64 bit

See the Writer Guide, the Writer FAQ, the Writer Tutorials and Writer for students.

Remember: Always save your Writer files as .odt files. - see here for the many reasons why.
User avatar
Hagar Delest
Moderator
Posts: 32627
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Saving to csv caused data loss in ods file

Post by Hagar Delest »

Except if there is a mishap at file handling level. I did experience that also in the past.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
waynec444
Posts: 84
Joined: Wed Jan 21, 2015 6:09 am

Re: Saving to csv caused data loss in ods file

Post by waynec444 »

Anytime I have closed the document before it has always opened with the current document as I saved it.

As I said, I have it set to autosave every 5 minutes so the document supposedly has been saved every 5 minutes. So the most I should lose is the last 5 minutes of data (not 2 hours worth).

All entries in the Tools/Options/LoadSave are checked except for editing before closing.

It has been suggested that the current saved file may be in the /backup folder. Where is that? How do I open it in OO if needed?

But, as I said, I resolved the issue by starting a new file and then importing the csv file to it. All data was there.

Also, after importing from the csv file I noticed that the size of the new file as 7kb less than the original file. I am assuming that OO has extraneous info that is not saved in the csv file. The number of entries is correct so it does not seem as if anything was lost.

Thanks for all your help.
Open Office 4.1.10 on Windows Vista
User avatar
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Saving to csv caused data loss in ods file

Post by RusselB »

That extraneous info is things like font style, font size, bolding, underlining, colors. These things are not, never have been, and probably never will be, saved in a .csv file.
There's also information that can allow a file to be reconstructed if the file is damaged.
OpenOffice 4.1.7, LibreOffice 7.0.1.2 on Windows 7 Pro, Ultimate & Windows 10 Home (2004)
If you believe your problem has been resolved, please go to your first post in this topic, click the Edit button and add [Solved] to the beginning of the Subject line.
User avatar
Hagar Delest
Moderator
Posts: 32627
Joined: Sun Oct 07, 2007 9:07 pm
Location: France

Re: Saving to csv caused data loss in ods file

Post by Hagar Delest »

waynec444 wrote:As I said, I have it set to autosave every 5 minutes so the document supposedly has been saved every 5 minutes. So the most I should lose is the last 5 minutes of data (not 2 hours worth).
No, that autosave is for recovery information, it does NOT save your actual file, just temporary files to be recovered in case of crash. Only a manual save will actually write the data in your file.
waynec444 wrote:It has been suggested that the current saved file may be in the /backup folder. Where is that? How do I open it in OO if needed?
See the link I've provided.
waynec444 wrote:Also, after importing from the csv file I noticed that the size of the new file as 7kb less than the original file. I am assuming that OO has extraneous info that is not saved in the csv file. The number of entries is correct so it does not seem as if anything was lost.
Surely some formatting was lost or formulas replaced by numbers perhaps.
LibreOffice 7.6.2.1 on Xubuntu 23.10 and 7.6.4.1 portable on Windows 10
waynec444
Posts: 84
Joined: Wed Jan 21, 2015 6:09 am

Re: Saving to csv caused data loss in ods file

Post by waynec444 »

Thanks for the info. Figured it might be something like that.
Open Office 4.1.10 on Windows Vista
Post Reply