ImportCSV Documentation

Globalissa.com

This page contains information about the ImportCSV tool.

Purpose

Visitors to your site may add their listing online using the register page. Webmasters may use the same tool. If you wish to add bulk data automatically, then you may use the included ImportCSV tool.

The purpose of the ImportCSV tool is to import csv data into a phpWhite directory. This tool automatically populates the database. ImportCSV takes the csv source file and loads it into your phpWhite directory. Many listings may be imported. The ImportCSV tool (with a yellow page crawler or csv file) gives you the capability to populate your unique directory with enough data to be a credible and competitive website in your niche market.

Creating a .csv source file

The phpWhite ImportCSV tool works with any properly formatted .csv file.


// example file format:
// NOTE: username and passwords are generated randomly
define('_csv_cols','organization,address,city,stateprov,postalcode,country,phone,fax,email,website');


// define what cols must have a value to be imported define('_csv_cols_mandatory','organization,city,stateprov,phone');

organization: a.k.a. company
stateprov: a.k.a. state
postalcode: a.k.a. zipcode
website: absolute url to domain including http:// . If not absolute then url may fail.

For example phpWhite ImportCSV tool works with YellowPageCrawler 3rd party software made by XShan at http://www.xshan.com

The specific product page is: http://www.xshan.com/Product/YPG.aspx Xshan also offers crawlers for your favorite site.

How to use YellowPageCrawler

Using the YellowPageCrawler is easy:

Browse to xshan homepage for more information about their product.

Using phpWhite ImportCSV

How to use

Rollback

This software has a rollback feature. After importing browse to your recent page recent.php. Examine the records. Are all the data fields correctly filled? If some data is wrong, for example there is a url where the email should be, then abort the import. The import may be aborted by clicking the 'Rollback' button. When clicked your database will revert to the state it was in prior to the most recent import.

Optional - Preparing data

If needed you may export a .csv file from Excel or equivalent application (see http://www.openoffice.org/).

Changing the default import order

To change the default csv column import order edit /modules/importcsv/manage_import_handler.php . Save a backup of manage_import_handler.php before you edit it. Look for about Line 39 which assigns the import order. Change the order to reflect your CSV file. Or change the csv file to reflect the default order below:

// example file format:
// NOTE: username and passwords are generated randomly
define('_csv_cols','organization,address,city,stateprov,postalcode,country,phone,fax,email,website');

organization: a.k.a. company
stateprov: a.k.a. state
postalcode: a.k.a. zipcode
website: absolute url to domain including http:// . If not absolute then url may fail.

Skipping records

The first data row is skipped. If you have data field labels (column names) in the first row - typical in some spreadsheets - the first row is ALWAYS discarded.

A malformed data record will also be skipped.

Keyword4 - optional

A keyword4 data field may be added to the .csv file. If present in the .csv file the importer will use the .csv keyword4. If there is no keyword4 data field present in the .csv file then the default posted keyword is used. If the keyword4 is not presently in your /templates/keyword4.txt file then it will be automatically appended.

Rank (listing type) - unnecessary

The default database value for rank (listing type) is used. If you wish to globally change the listing type you may do so using SQL commands with phpMyAdmin or via the included EasySQL command line tool.

Listing Rank and Type
0 bronze
1 silver
2 gold
3 minipage
4 sponsor

How to install

Ignore this section. The phpWhite ImportCSV tool is already installed.

Known issues

Filesize:
There is no limit on filesize uploaded by ImportCSV, however your web server DOES have a limit on the size of file permitted for upload. This may be identified with admin > phpinfo(), or by looking in php.ini. The parameter is called upload_max_filesize and a typical value is 2 megabytes. Two megs is not sufficient for larger csv data files. If you find ImportCSV is not loading your csv file then check your upload_max_filesize. If upload_max_filesize is a small number, then ask your domain host isp to increase the permitted upload file size.

Success story

One customer started with a couple of thousand records of their own. After finding the ImportCSV tool and installing an evaluation crawler, they had a lot more data. In the space of 2 days the webmaster imported over 500,000 records! That's half a million! Almost overnight this website became data leaders in their field.

Your mileage may vary. You may not want to import that many records, or there may be less data available in your particular niche market, however you do have the potential to grow to big numbers with the ImportCSV tool.

Services


We also offer a hands off data import service where we do all the work for you.
Inquire for details.