OpenOffice.org Forum at OOoForum.orgThe OpenOffice.org Forum
 
 [Home]   [FAQ]   [Search]   [Memberlist]   [Usergroups]   [Register
 [Profile]   [Log in to check your private messages]   [Log in

Importing CSV – Help finding problem

 
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc
View previous topic :: View next topic  
Author Message
Earthenware
General User
General User


Joined: 11 Apr 2012
Posts: 5

PostPosted: Sun Jun 10, 2012 8:22 am    Post subject: Importing CSV – Help finding problem Reply with quote

I'm having trouble importing a CSV into Calc and I can't work out why.

On a few lines, Calc isn't recognising the EOL and is appending lines to the previous one.
In the Import Text dialogue, the problem lines seem to show that the first field begins with a funny arrow character which I take to mean a carriage return – ie that there is some sort of mis-formatted CR in the first field of the line, rather than the CR being at the end of the previous line.

What is throwing me is that no other application interprets the file this way and a Hex Editor (XVI32) shows no difference between lines that act the 'right' way and lines that act the 'wrong' way. It shows no more and no less carriage returns between any lines in the file.

For some reason, Calc seems to be saying that in some cases the CR is at the start of the new line and not at the end of the previous line.

I'm happy to concede that the CSV file is at fault (created with PHP fputcsv) but if a Hex Editor can't find the CR that Calc says is there, I'm a bit stumped as to how I can diagnose the problem.

Can anyone suggest an approach which might help me diagnose please?
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Sun Jun 10, 2012 10:09 am    Post subject: Reply with quote

You think it is a common problem? No, it is not. Without any concrete data file it is impossible to help
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
jrkrideau
Super User
Super User


Joined: 08 Aug 2005
Posts: 6732
Location: Kingston ON Canada

PostPosted: Mon Jun 11, 2012 5:03 am    Post subject: Re: Importing CSV – Help finding problem Reply with quote

Earthenware wrote:
I'm having trouble importing a CSV into Calc and I can't work out why.

On a few lines, Calc isn't recognising the EOL and is appending lines to the previous one.
In the Import Text dialogue, the problem lines seem to show that the first field begins with a funny arrow character which I take to mean a carriage return – ie that there is some sort of mis-formatted CR in the first field of the line, rather than the CR being at the end of the previous line.

What is throwing me is that no other application interprets the file this way and a Hex Editor (XVI32) shows no difference between lines that act the 'right' way and lines that act the 'wrong' way. It shows no more and no less carriage returns between any lines in the file.

For some reason, Calc seems to be saying that in some cases the CR is at the start of the new line and not at the end of the previous line.

I'm happy to concede that the CSV file is at fault (created with PHP fputcsv) but if a Hex Editor can't find the CR that Calc says is there, I'm a bit stumped as to how I can diagnose the problem.

Can anyone suggest an approach which might help me diagnose please?


We really need an example of the problem if possible. You can upload a file to someplace such as MediaFire for other forum reader to examine.
_________________
jrkrideau
Kingston ON Canada
Currently using Windows 7 & OOo 3.4.0 and Ubuntu 12.04 & LibreOffice 3.5.2.2
Back to top
View user's profile Send private message
Earthenware
General User
General User


Joined: 11 Apr 2012
Posts: 5

PostPosted: Wed Jun 13, 2012 11:18 pm    Post subject: Reply with quote

Thanks for the responses.

It turned out to be a problem with encoding in my PHP. I had characters which required UTF but I was not processing them properly.

Once I corrected this the CSV file imported into Calc nicely. I didn't bother to go back and find out exactly which characters caused the problem.
Back to top
View user's profile Send private message
Villeroy
Super User
Super User


Joined: 04 Oct 2004
Posts: 10106
Location: Germany

PostPosted: Thu Jun 14, 2012 6:29 am    Post subject: Reply with quote

Thank you for clarification.
Very much apprechiated.
_________________
Rest in peace, oooforum.org
Get help on https://forum.openoffice.org
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OOoForum.org Forum Index -> OpenOffice.org Calc All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group