[Solved] File saved with wrong separator

Discuss the spreadsheet application
Post Reply
Stockman1
Posts: 33
Joined: Tue Jul 08, 2014 1:08 pm

[Solved] File saved with wrong separator

Post by Stockman1 »

We have a .ods sheet derived from a .CSV from our supplier.

I can see that the original sheet was opened with both the "," and "|" as separators.

This was an error because only the "|" should have been used.

This means that wherever there was a "," in the body of the spreadsheet the data in a particular cell after the "," got shunted over to the next cell.

Unfortunately 3 months of work have gone into the sheet since then. But it has been saved as .ods each time without anyone noticing that the columns are wrong wherever a row had a comma in it.

Is there any way to open the current .ods file so that the columns are back to how they would have been had the "''," not been used as a separator.

I have attached a small section of the file for clarity

Thank you.
Attachments
sample for forum.ods
(47.04 KiB) Downloaded 61 times
Last edited by Stockman1 on Thu Mar 08, 2018 5:04 pm, edited 1 time in total.
Open Office 4.1 / Windows Vista
User avatar
Zizi64
Volunteer
Posts: 11362
Joined: Wed May 26, 2010 7:55 am
Location: Budapest, Hungary

Re: Opening a file which was saved with wrong separator

Post by Zizi64 »

You can adjust the properties of the Import filter. You can set up the separator character/s/, can set the format of thew columns...
Tibor Kovacs, Hungary; LO7.5.8 /Win7-10 x64Prof.
PortableApps/winPenPack: LO3.3.0-7.6.2;AOO4.1.14
Please, edit the initial post in the topic: add the word [Solved] at the beginning of the subject line - if your problem has been solved.
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: Opening a file which was saved with wrong separator

Post by Lupp »

You are surely aware of the fact that the commas wrongly used as cell separators are no longer present in the file in any way.
Thus a reconstruction of original entries containing a comma depends on the correct recognition of the rows where this needs to be done. Without your thorough explanation concerning the related characteristics any proposal based on stabbing in the dark may miss needed correctens and, even worse, may introduce new errors probably only noticed by you another few months later.

Please give a clear "syntactical" explanation, and name a dozen (or so) rows where the wrong splitting occured together with the cell contents as they should be.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Stockman1
Posts: 33
Joined: Tue Jul 08, 2014 1:08 pm

Re: Opening a file which was saved with wrong separator

Post by Stockman1 »

Please see row 128 and 129 at columns W. At that point, what is in W should be in V, what is in X should be in W etc.
Because of the uniform nature of most of the columns, the error at V128 and V129 and then many lines below will be very apparent.
Open Office 4.1 / Windows Vista
User avatar
soby
Volunteer
Posts: 150
Joined: Sat Oct 29, 2016 10:49 am

Re: Opening a file which was saved with wrong separator

Post by soby »

As Lupp explained we're in the dark, but we all want to help, can you provide us with a little original .csv from your supplier. The attachment is not really of help for us. We want our self inspect the file so we can see the problem.
Libre Office 6.1 dev homebuild Open Office 4.1.5 on Slackware64 current
User avatar
keme
Volunteer
Posts: 3705
Joined: Wed Nov 28, 2007 10:27 am
Location: Egersund, Norway

Re: Opening a file which was saved with wrong separator

Post by keme »

If you don't have the file that soby mentioned (or if that is not relevant to your current issue), the best solution may be to export as CSV again, and edit that text file by hand before importing it back. In any case, reliably locating the faulty rows is the greater challenge, I guess.

One approach to giving guidance to people who try to help you:
  • Provide an overview of which columns you require. A list of headings should do (preferably one which fits the actual table in your previous attachment).
  • Also, tell us which columns may have contained a comma. Typically they are in descriptive fields and in numbers, but not in product codes or status fields.
  • For the columns with a limited set of possible values, it would help to know which values are permissible (like "integers from 0 to 2000", "Y and N", "Red, Green, Black and Silver"). That makes it easier to create automated markup for rows that require fixing. As you say, the errors is often apparent when you look at them, but locating them by manually browsing a table of 1000 rows and 30 columns is tedious work, and there is a good chance that some mistake will be missed.
  • Did the blank columns F through O also come about because of mistakenly interpreted column separators, or did you remove something (e.g. confidential info)?
Stockman1
Posts: 33
Joined: Tue Jul 08, 2014 1:08 pm

Re: Opening a file which was saved with wrong separator

Post by Stockman1 »

Thanks for the reply Keme.
Yes you've accurately guessed that we have sensitive information within the file hence the problem sending the original file in it's un-adjusted form.
As there does not seem to be a 'stock' fix for this problem I have had a rethink.
We have only added to new and inserted columns. Therefore I am able to do a vlookup from the original file and import cells from the original csv to the ods file(s).
It's going to take a while as there are many lines and I know that once lookups go beyond 100000 lines on this pc I have to go for lunch.
Thanks all for your input.
Marking as solved
Open Office 4.1 / Windows Vista
User avatar
Lupp
Volunteer
Posts: 3553
Joined: Sat May 31, 2014 7:05 pm
Location: München, Germany

Re: [Solved] File saved with wrong separator

Post by Lupp »

Stockman1 wrote:Please see row 128 and 129 at columns W. At that point, what is in W should be in V, what is in X should be in W etc.
On the other hand there are many rows where a content obviously belonging to column Z actually is dislocated to column Y or even farther to the left. In fact the short sample contains exactly 661 cases where a single N or Y is contained in a cell within the range of columns from W through Y. Well, in a majority of these cases there is also a N/Y flag in column Z, but in many cases there is none.
Stockman1 wrote:Because of the uniform nature of most of the columns, the error at V128 and V129 and then many lines below will be very apparent.
Regarding my findings above I cannot confirm this. In specific column W doesn't seem to contain a consistent type of information. However, excluding columns W and V still leaves 165 cases where column Y contains the displaced Y/N. In none of these cases Z also has such a flag.
That's no basis for any reliable advice.
On Windows 10: LibreOffice 24.2 (new numbering) and older versions, PortableOpenOffice 4.1.7 and older, StarOffice 5.2
---
Lupp from München
Post Reply