On Thu, 28 Sep 2006, Dennis Cote wrote:
I suspect you may have trailing spaces at the ends of your lines. The
.import command isn't very smart about things like that. Your separator is
set to one space, not arbitrary whitespace. It there is another separator
after the last field it assumes there is another field there (which might
be an empty string) as well.
Well, I'm back with the same problem, but a trailing space at the end of a
record is not the problem.
I wrote data from a table using 'insert' mode so I could drop and recreate
the table without having to manually re-enter the data. That part worked
just fine: the new table schema matches the number and type of fields in the
data file.
However, when I try to import the data into the table I see this error
message:
sqlite> .import variable.sql variable
variable.sql line 1: expected 14 columns of data but found 16
The editor is configured like this:
sqlite> .show
echo: off
explain: off
headers: off
mode: insert
nullvalue: ""
output: stdout
separator: ","
width:
and the first line of data is:
INSERT INTO variable VALUES('Vegetation','Amounts, types, and uses of plant
cover.','Habitats','','External','x
100','Centroid',0,100,0.2,'Strong','Fuzzy Space','Minimum','Min-max');
There are 14 fields and no extra space trailing the final ';'. The schema
is attached for reference.
What have I gotten wrong this time, please?
Rich
--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc. | Accelerator(TM)
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863
CREATE TABLE variable (var_name TEXT NOT NULL, var_desc TEXT,
policy_name TEXT NOT NULL, subpolicy_name TEXT,
var_data_src TEXT, var_scale TEXT, var_defuz TEXT,
var_UoD_low INTEGER, var_UoD_high INTEGER, var_alpha_cut REAL,
var_alpha_type TEXT, var_cons_geom TEXT, var_corr_meth TEXT,
var_impl_meth TEXT, PRIMARY KEY (var_name, policy_name));
-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------