PDA

View Full Version : CSV Import Problems


BeerNuts
01-22-2009, 08:49 AM
Hey guys,

Ive got a csv from a ripper of mine. In excel the file looks perfect its got 8 columns and I added category names at the top row.

When i go to import my csv and go to page 2 of the review script it loads every entry in the csv as a column making the page like 1000 lines long. It will not figure out that I have 8 columns and not like 1000 columns.

Category,Company Name,Address,City,State,Zip,Phone,Site
sample cat,sample name,sample addy,sample city,sample state,sample zip,sample phone,sample site

Here is the first 2 lines of the csvm what am I doing wrong?

ryan
01-22-2009, 12:22 PM
What does the data look like if you open the file in Notepad? I'm guessing that the encoding might be usual or the line-endings are in an unexpected format.

PM sent.

ryan
01-22-2009, 03:41 PM
Thanks for sending me your CSV file to diagnose the problem.

The problem with the CSV file is that the line-endings are incorrect. At the end of each line there are special characters that tell a program that the line has ended. Each operating system uses different combinations of these hidden characters to signify the ending of a line. Windows uses a carriage return and a line feed (commonly referred to as “CR/LF” or “\r\n”) while Linux uses only the line feed (LF or “\n”). Your CSV file is only using the carriage return (CR or “\r”, typically the format used by Macs) so the script (running on Linux/PHP) doesn’t parse the file properly.

In short, the line endings need to be fixed. If you are running Windows, you can try just opening the file in Excel and re-saving it as a true Excel file, and then re-saving it to CSV again. I used a program called Notepad2 to open it, and just selected “Line endings -> Windows” from the “File” menu.

Hope that long winded explanation helps. :)

BeerNuts
01-22-2009, 09:52 PM
Your CSV file is only using the carriage return (CR or “\r”, typically the format used by Macs) so the script (running on Linux/PHP) doesn’t parse the file properly.

That's going to be a problem since I have a Mac. I have no way of adding the other type of carriage return. It also seems that if I get a file with the proper return and save it to my mac it resets it back to the mac return. :confused:

ryan
01-23-2009, 12:11 AM
I'm looking into a solution for Mac users. I'll know more on Saturday.

snaps
01-25-2009, 07:27 AM
Another problem is that here in the EU, csv files use semi colon instead of comma, so it wont import an regular csv file. Ofcourse this is easy to work around, but it would be nice if it was supported.

Thaks

nickmattern
01-25-2009, 08:05 AM
Another problem is that here in the EU, csv files use semi colon instead of comma, so it wont import an regular csv file. Ofcourse this is easy to work around, but it would be nice if it was supported.

Thaks

Not exactly. There are a lot of delimiters a flat file may have. Spaces, tabs, colons, semicolons, pipes, etc. You simply need to make sure the flat file is CSV, or comma separated.

If you have a file that's in a different delimited format than comma separated, simple pop the file into excel (make sure you use the data > text import feature in 2007 or the Data > import > text file feature in 2003) and save the file as CSV. (File > Save As > Drop the type down to Comma Separated Windows)

We'll put the multi-delimiter option on teh list of things to discuss for the upcoming version. For now, if anyone has a problem with delimiters, please feel free to ask for help here!

ryan
01-31-2009, 11:00 AM
Version 1.1.3 beta supports Mac-style line endings.

Download: http://reviewpluginforwordpress.com/download/wfreview-v1.1.3-beta.zip

If you have any problems, let me know.

BeerNuts
01-31-2009, 07:59 PM
Kick ass I can finally use this thing! Thanks the beta is working great.

ryan
02-01-2009, 12:01 PM
Glad to hear it and thanks for the feedback.

mot-k
11-18-2009, 08:06 AM
I see how to import CSV events. However, is there a way to specify the end time and end date during the import?

nickmattern
11-18-2009, 08:07 AM
I see how to import CSV events. However, is there a way to specify the end time and end date during the import?

Yes, step 3.

WhatupG
12-23-2009, 03:05 AM
When is the plugin going to have support for other delimiters?

Sure it's easy, and common to use CSV, but not practical for websites unless you somehow have text without any commas. The plugin cuts the posts whenever it encounters a comma or ' or similar characters. When can we just make our own custom delimiters such as ~ or | that are not likely to be contained in the text of our data?

For now I have been butchering my data to remove these characters, but it makes the writing choppy and filled with bad grammar. Words like can't I have to make 'cant' , and I have to remove all the commas.

Some great features as the plugin improves, but I'm surprised to still be having this issue. Is there an ETA for a resolution on this?