Issue with CSV formatting

Discuss the spreadsheet application
Post Reply
seanxjohnson
Posts: 2
Joined: Wed Nov 15, 2017 2:49 am

Issue with CSV formatting

Post by seanxjohnson »

I went to import some files today and got an error saying a field was missing. When I looked at the file the words after the comma of each field had shifted to the right. I manually edited, saved, and tried again, but got the same error. Below are some pictures:

How it defaulted

Image

Switched to semi-colon as well as comma, has the shift at the comma.

Image

The input for what I'm trying to do only accepts comma, so any help resolving this is appreciated!
Open Office 4.1.4 on Windows 10
FJCC
Moderator
Posts: 9277
Joined: Sat Nov 08, 2008 8:08 pm
Location: Colorado, USA

Re: Issue with CSV formatting

Post by FJCC »

It is hard to be sure without seeing your actual data but it seems that the semicolon is the only separator in this data. Deselect the comma as a separator for the input. If you need to save it with a comma separator, use the menu File -> Save As and choose to Edit Filter Settings. In the next dialog, choose Quote All Text Cells. The other application should ignore commas within quotes.
OpenOffice 4.1 on Windows 10 and Linux Mint
If your question is answered, please go to your first post, select the Edit button, and add [Solved] to the beginning of the title.
John_Ha
Volunteer
Posts: 9584
Joined: Fri Sep 18, 2009 5:51 pm
Location: UK

Re: Issue with CSV formatting

Post by John_Ha »

seanxjohnson wrote:Switched to semi-colon as well as comma, has the shift at the comma.
Untick comma.

You have a comma in your data so the comma is causing the jump to the next column. Your data uses semicolons to separate it so choose semicolon in the box.
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
RusselB
Moderator
Posts: 6646
Joined: Fri Jan 03, 2014 7:31 am
Location: Sarnia, ON

Re: Issue with CSV formatting

Post by RusselB »

The data being read after the comma, from what I can see, are numbers. which, by default, are right justified in Calc.
That is what you are seeing when you state "had shifted to the right"
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.
seanxjohnson
Posts: 2
Joined: Wed Nov 15, 2017 2:49 am

Re: Issue with CSV formatting

Post by seanxjohnson »

Thank you for the replies. I tried some of the solutions posted and have been unsuccessful. I wasn't entirely clear with my initial post -- if I select comma in the initial pop-up it formats the columns correctly, however, if one of the cells has a comma in it (a card name) it shifts the cells one spot to the right. See the example below, line 31 should read Cho-Manno, Revolutionary in a singular cell, however it is shifting it at the comma and adding quotes.

Image
Open Office 4.1.4 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Issue with CSV formatting

Post by Villeroy »

Text delimiter = " (double quote)

so "Time Spiral ""TImeshifted""" becomes Time Spiral "Timeshifted"
and "Intet | the Dreamer" becomes Intet; the Dreamer
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
Post Reply