close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Invalid Field Count CSV Input on Line 1

Thread began 11/05/2012 11:12 am by M2Media | Last modified 12/06/2012 3:25 pm by Jason Byrnes | 13963 views | 30 replies |

M2Media

Invalid Field Count CSV Input on Line 1

I've been having issues with getting close to 10,000 subscribers into pm1_users.

1. I tried to import an xls file but have learned that no longer works.

2. To be sure there isn't something wrong with the database, I started with just one subscriber and created a CSV file. I've tried it with the exact field names as pm1_users and the header and the same without the header. In both cases I get Invalid Field Count CSV Input on Line 1

3. I'm told that "the column count in the CSV file does not match the column count of the table you are importing to." But I'm clueless as to how I correct that. In Numbers, I've assigned the length of each column to be the same as pm1_users. What am I doing wrong?

Sign in to reply to this post

Jason ByrnesWebAssist

power messenger does not have support for using CSV data for the eamil list.

you will need to Import the CSV File to the Power Messenger MySQL Database using PHPMyAdmin or another MySQL GUI Tool.

importing CSV data to your database can be tricky.

the CSV file will need to be formatted correctly to fit the requirements of the Power Messenger database. The first row of the CSV file will need to set the column names, and use the same naming convention of the power messenger database. you dont need to include all of these columns in the csv file, but the column names you can use are:

UserEmail
UserFirstName
UserLastName
UserCity
UserState
UserZip
UserPhone
UserFax
UserCountry
UserAddress
UserAddress2

Once the CSV file is edited to include the column names, open it in a text editor like TextWrangler or Notepad

the first row will be a comma separated list of the column names, select the entire first row and select Edit -> Cut, make sure not to leave an empty row at the beging and save it (I recomend using save as to save it with a different name.

The reason for this step is that we need a comma separated list of the column names that are being imported in the same order as the columns in the csv file, this is needed for the import operation in PHPMyAdmin, we dont want to leave the column names in the CSV file, or a row will be inserted in the database with the column names.

I recommend using the save as method so you have one csv file with the data and column names and another with just the data, this way as your experimenting, you can easily copy the comma separated list of column names again.

Now open PHPMyADmin, select the power mesenger database, and select the pm1_users table

Go to the Import Tab.

Click the location of text file and select the csv file that has only the data in it

under the section "Format of imported file" select CSV.

Leave all the defaults as is except for:
In Fields terminated by, change that to a comma ","

In Column name paste the comma separated list of the columns that had been cut from the CSV file.

then click go.

Sign in to reply to this post

M2Media

Originally Said By: Jason Byrnes
  power messenger does not have support for using CSV data for the eamil list.
importing CSV data to your database can be tricky.  



Yes. It sounds VERY tricky but I'll give it a try. Thank you.

Sign in to reply to this post

M2Media

I followed the instructions to the letter and still get the same message.

Sign in to reply to this post

Jason ByrnesWebAssist

Your CSV file must not be formatted correctly.

please send a copy ofd the CSV

Sign in to reply to this post

M2Media

Originally Said By: Jason Byrnes
  Your CSV file must not be formatted correctly.

please send a copy ofd the CSV  



I just tried to do an attachment under Additional Options and got the message "Invalid file"

Sign in to reply to this post

Jason ByrnesWebAssist

compress the csv to a zip archive

Sign in to reply to this post

M2Media

Originally Said By: Jason Byrnes
  compress the csv to a zip archive  



Good call.

Done.

Attached Files
test-subscribers.csv.zip
Sign in to reply to this post

Jason ByrnesWebAssist

you should have quotes around each field. for example:


"test@domain.com","John","Doe","New Orleans","LA","70129","555-555-5555","USA","1024 Meterie Rd.",""


in the CSV, you should not include the column name.

Remove that from the main CSV file and copy the column names list to another file.

use that other file for copying the column names list into the PHPMyAdmin interface when doing the import.

Sign in to reply to this post

M2Media

Originally Said By: Jason Byrnes
  you should have quotes around each field. for example:


"test@domain.com","John","Doe","New Orleans","LA","70129","555-555-5555","USA","1024 Meterie Rd.",""


in the CSV, you should not include the column name.

Remove that from the main CSV file and copy the column names list to another file.

use that other file for copying the column names list into the PHPMyAdmin interface when doing the import.  




Okay! We're getting somewhere. John Doe is our first subscriber.

I like this message better: Import has been successfully finished, 2 queries executed.

The issue must be that I have test@domain.com rather than "test@domain.com"? If so, where to the quotes come from?

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...