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

Table Maintenace: Category : Errors

Quote Reply
Table Maintenace: Category : Errors
Hello!

I get this import errors as following :

Aborting, too many errors!

Rows imported: 0
Errors with the following rows:

2: Row count: 2 does not match header count: 9
3: Row count: 2 does not match header count: 9
4: Row count: 2 does not match header count: 9

.......

The database has been newly created. The location of the file is correct. The delimiter is |
The number of the fields are the same as that in the database. The first field contains the names. Everything looks to be fine.

Any help?


------------------
rajani











Quote Reply
Re: Table Maintenace: Category : Errors In reply to
I was playing with the RDF import and importing from a 'standard' links database last night. Most of my entries in the links database were manually entered, through ADMIN, and had lots of empty fields.

I had a lot of problems with the Import as well. (both by Import.pl and by pasting into the sql box)

You need to make sure that if you have 9 header columns, you have 9 columns in each row.

A row ending in a '|' indicates an extra column, so:

xxx|xxx|xxx|

is actually _4_ columns


I had a problem with 'hits cannot be empty' and other problems that I edited my links.db several times to make it work.

I still have date fields set to 000-000-00 and other oddities that I'll have ot work on, but I think Alex made some assumptions in the import routine that need to be a bit more flexible....

Not all links will have hits, or date fields filled out.
Quote Reply
Re: Table Maintenace: Category : Errors In reply to
Also, the URL's didn't seem to be added to the URL list for a 'check links' run.

I'm double checking now after rebuilding and reindexing (although I'm sure I did that before running the check links last night).

Quote Reply
Re: Table Maintenace: Category : Errors In reply to
 
Quote:
2: Row count: 2 does not match header count: 9

This means your line number 2 only has 2 fields, whereas your header line had 9 fields. Make sure your lines have the same number of fields as your header row.

Quote:
I was playing with the RDF import and importing from a 'standard' links database last night

RDF_Import.pl is for importing from a content.rdf file, not from a standard Links database?
Also if you are importing from a Links 2.0 database, you should use the Import.pl script and not the web based admin. The Import.pl script will fix up things like changing the category name to an ID, changing the date format, setting defaults, etc. The Web based Import is really for putting Links back in the same way they came out.

Cheers,

Alex
Quote Reply
Re: Table Maintenace: Category : Errors In reply to
Hello Alex!

This is not true. Line number has exactly nine fields as the fisrt line.

I also discovered by playing about the Delimiter at the end | what happens if its there or not. When I take it out from the first and the second then it counts one field less!

So all the lines are matching and also the fields are matching. After this I checked that there error still remains. Hence the message here.

By the way it was an access exported data with the name category.db with pipe delimiter. Tested with the pipe ate the end and also without. I will also try to run it with import.pl and tell here what happened.


------------------
rajani











Quote Reply
Re: Table Maintenace: Category : Errors In reply to
Code:

quote:

I was playing with the RDF import and importing from a 'standard' links database last night


RDF_Import.pl is for importing from a content.rdf file, not from a standard Links database?
Also if you are importing from a Links 2.0 database, you should use the Import.pl script and not the web based
admin. The Import.pl script will fix up things like changing the category name to an ID, changing the date format,
setting defaults, etc. The Web based Import is really for putting Links back in the same way they came out.

I was doing a couple of things. I imported a subset of the RDF file -- as per answer to one question/problem posted today, but I was also importing (or trying to import) my links 2.0 test database into LinkSQL.

How these were related is they both were being imported into LinkSQL.

I used Parse_RDF.pl for the rDF file, of course. I used Import.pl _and_ cut/paste, and just about all other things too.

It was not smooth, nor error free.

Import.pl died because I had my 'HIT' column set to '' because the data was imported into links 2.0 and had no hits. I had to set it to '0'. I had to do the same with 'date', but ended up with 0000-000-00

Import.pl _refused_ to import because it was trying to validate fields that had no value to validate.

'hit cannot be empty' was the major offender, followed by "Invalid date format" for missing or dates listed as xx-xx-xx or xx/xx/xx

The gist of it all is that if title columns are provided (headers) then that should be mapped field by field to the new database -- ignoring missing values and/or extra items.

Import.pl needs to be a bit more flexible, since links20 used a flat file database, a lot of data was originally imported directly into it by a lot of people, and not all fields are going to have values.

BTW... changing the def files to 'not required' values had no effect, in case you wondered.

I did a _lot_ of playing last night...

Quote Reply
Re: Table Maintenace: Category : Errors In reply to
 
Quote:
This is not true. Line number has exactly nine fields as the fisrt line.


Can you email me the file so I can take a look?

Quote:
Import.pl died because I had my 'HIT' column set to '' because the data was imported into links 2.0 and had no hits. I had to set it to '0'. I had to do the same with 'date', but ended up with 0000-000-00

I've added:

$values{'Hits'} | |= 0;

to the Import.pl so Hits will default to 0 if not specified. As for the date format, you'll need to tweak the &convert_date subroutine from whatever date format you had before, to yyyy-mm-dd format. The Import.pl script only handles Links 2.0 default dd-MMM-yyyy format.

I'd rather Import.pl be a bit too restrictive and throw up errors, then having incorrect data get entered into the table.

Cheers,

Alex
Quote Reply
Re: Table Maintenace: Category : Errors In reply to
But on the date... if the date defaults to the current date, rather than 0000-000-00 it looks a bit more professional.... or even to a 'default date' that could be set to something old. If the date fields were empty, that's what happened, the current date or default date wasn't inserted.