Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

Importing data

Quote Reply
Importing data
Hi
Can someone assist in saving me time? I tried the Dirt search script from dirt dobber and had a few problems so have switched to links sql. I have 500+ categories and cannot import them, I get these errors

Aborting, too many errors!

Rows imported: 0
Errors with the following rows:

2: Row count: 4 does not match header count: 3
3: Row count: 4 does not match header count: 3
4: Row count: 4 does not match header count: 3
5: Row count: 4 does not match header count: 3
6: Row count: 4 does not match header count: 3
7: Row count: 4 does not match header count: 3
8: Row count: 4 does not match header count: 3
9: Row count: 4 does not match header count: 3
10: Row count: 4 does not match header count: 3
11: Row count: 4 does not match header count: 3

12: Row count: 4 does not match header count: 3

The layout is ID| name| description
I have exported the file using phpadmin but cannot import it into links. I set the first line to read
ID|Name|Description

Any help will be gratefully received

Iain Stubley

Quote Reply
Re: Importing data In reply to
Hello!

You have some things to do, one may work.

1.

Make sure that the first field has a value.

2.

Make sure that there is a value in the last field.

3.

You can try to have the table value and also the defs set to "Not required". That means that it will have zero instead of one.

4.

Make sure that there is no default value filled in.

5.

That there is no validation in the last field od the defs.

6.

The best results you will have if there is a value between every field!

One of the above, try in a sequence written above, shall work for you with trial and error.

Hope this helps.
Quote Reply
Re: Importing data In reply to
Yep... this is a problem for some sorts of
records... there is an off-by-one error, and no matter what you do to try to get around it, the error adjusts Smile

If what you are trying to do is import a series of fields into Links, but not in the format of a Links database, then what often helps is to turn off error checking -- meaning make all the "required" fields in the .def file '0'

Some sort of matching of required fields to imported fields seems to be taking place, but I haven't found it.... Smile

You can also modify the current table you have, to look like the "Category" table, then copy it over to the Links database. I did this once, but the process is different for every database.

Try turning off required fields, and see if the errors go away. The other thing is to look really closely, and see if you are trying to import an extra field, or a field that doesn't exist -- if you need to, create a dummy field, and delete it later.

good luck Wink

------------------
POSTCARDS.COM -- Everything Postcards on the Internet www.postcards.com
LinkSQL FAQ: www.postcards.com/FAQ/LinkSQL/







Quote Reply
Re: Importing data In reply to
Thanks for the help ... I'll let you know once I try it

Iain
Quote Reply
Re: Importing data In reply to
Hi

I have tried but have not succeeded I imported all the data from the dirtsearch script to a csv file using phpadmin. I then opened it in access setting all the deliminators and field names as per the way linkssql exports. I then imported the modified dirtsearch into links but I still get errors! here are the first few line I am trying to import if I am being stupid and overlooking something please tell me...

first line
ID;Name;Description;Meta_Description;Meta_Keywords;Header;Footer;Number_of_Links;Has_New_Links

Data I want to import
4;Art and Literature;Art , Authors , Books , Poetry , Reviews...;;;;;0;No
5;Art and Literature/Art;;;;;;0;No
6;Art and Literature/Books;;;;;;0;No
7;Art and Literature/Poetry;;;;;;0;No
8;Art and Literature /Services;;;;;;0;No
9;Art and Literature /Literature;;;;;;0;No

Thanks for taking time to help

Iain
Quote Reply
Re: Importing data In reply to
Hello!

Accidently I saw your thread once again. I do not visit this forum frequently anymore. But to share with you my experience...

1.
I always used pipelined delimiter as | for the field terminations.

So the first line as header and the data all will had pipeline demiliter, in my case.

During import editor.cgi has a small box where you could specify what kind of de-limiter is used, Semicolon or a Pipeline delimiter, in the INFILE data file.txt to be imported.

2.
I removed the last field from the Category.def and left it empty.

3.
I changed the field required definition to - Can be empty - !

This would be the third last field (or the fifth field, not sure).

4.
Remove any Validation codes from the last field.

My field definitions look like :

Category.def

Name => ['3', 'CHAR', '40', '255', '0', '', '', ''],

So this worked for me. However may be this may not be the only or the solution or even the rootcause of the problem having values in there. All this is try your luck approach with Links SQL if I have to conclude my experience.

In the past I have had big nightmares on such areas and also have posted many messages. Very unfortunate that the build and import routines are not well developed which happens to be the central pivot of the program in comparision to many other small impact or cosmetic features.
Quote Reply
Re: Importing data In reply to
If you can provide me with a URL where I can download what you are trying to import, I can give you an idea of what the problem is.

Cheers,

Alex
Quote Reply
Re: Importing data In reply to
Hi Alex, rajani, and Pugdog

I have succeeded in importing. After building up the categories to contain the 9 fields then exporting to text with the pipe deliminator turning error checking off and delting all the data in my db I got it to work ... www.intheuk.net/search this is still in the design stages I hasten to add

Iain