I have a file as follows:-
Line 1 This is a Test
Line 2
Line 3 The End
I'm running the Informix on SCO OpenServer 5.x.
When try to load the above mentioned files to a table, I always get the
following error.
846: Number of values in load file is not equal to number of columns.
847: Error in load file line 2.
Please help!!!!!
Thanks
You could place a | at the end of each line and load it then.
so it would look like:
Line 1 This is a Test|
Line 2 |
Line 3 The End|
the delimiter is the | symbol
Cheers
Leon
- .... .. ... - --- --- ... .... .- .-.. .-.. .--. .- ... ...
How many fields in your table?
As informix usually defaults to the pipe '|' delimiter, your
data would probably be better as
Line 1 | This is a Test
Line 2 |
Line 3 | The End
if it is 2 fields.
Colin Bull
c.b...@VideoNetworks.com
Can you provide more information about the table you're loading
into?
--
----------------------------------------------------------------------
David Ranney
d...@bayarea.net
Exactly like that?
> I'm running the Informix on SCO OpenServer 5.x.
>
> When try to load the above mentioned files to a table, I always get the
> following error.
>
> 846: Number of values in load file is not equal to number of columns.
> 847: Error in load file line 2.
What command are you using to load and what file format is it expecting?
If it is expecting delimited, then you need delimiters in your file. I
would expect at least one delimiter at the end of each line.
Cheers,
--
Mark.
+----------------------------------------------------------+-----------+
| Mark D. Stock mailto:mds...@MydasSolutions.com |//////// /|
| Mydas Solutions Ltd http://MydasSolutions.com |///// / //|
| +-----------------------------------+//// / ///|
| |We value your comments, which have |/// / ////|
| |been recorded and automatically |// / /////|
| |emailed back to us for our records.|/ ////////|
+----------------------+-----------------------------------+-----------+
So if I were to do 1 by 1, it will be very tedious and this is not only 1
time off.
Therefore, I need a solution whether it is from Informix or a script from
Unix to add that | into the blank line. And the problem will be solved bu
itself.
Appreciate your help.
----- Original Message -----
From: "Leon Pappadopoulos" <le...@nja.co.za>
To: "Yeo Hwee Kiong" <hk...@penguin.com.sg>; <inform...@iiug.org>
Sent: Wednesday, July 10, 2002 10:01 PM
Subject: RE: Informix - load command
> Hi Yeo
>
> You could place a | at the end of each line and load it then.
>
> so it would look like:
>
> Line 1 This is a Test|
> Line 2 |
> Line 3 The End|
>
> the delimiter is the | symbol
>
> Cheers
>
> Leon
>
> - .... .. ... - --- --- ... .... .- .-.. .-.. .--. .- ... ...
>
> -----Original Message-----
> From: Yeo Hwee Kiong [mailto:hk...@penguin.com.sg]
> Sent: Wednesday, July 10, 2002 3:43 PM
> To: inform...@iiug.org
> Subject: Informix - load command
>
>
> Can anybody help me inregards to the following issues:-
>
> I have a file as follows:-
>
> Line 1 This is a Test
> Line 2
> Line 3 The End
>
> I'm running the Informix on SCO OpenServer 5.x.
>
> When try to load the above mentioned files to a table, I always get the
> following error.
>
> 846: Number of values in load file is not equal to number of columns.
> 847: Error in load file line 2.
>
>
> Please help!!!!!
>
> Thanks
>
You can use simple UNIX commands to add '|' at end of the line.
cat filename | sed 's/$/\|/'
-Hai
Try the following.
file b contains
1
2
3
% nawk '{ printf ("%s|\n", $0);}' < b
1|
2|
3|
% nawk '{ printf ("%s|\n", $0);}' < b > other file
PS. If you use Solaris, use nawk. Else use awk.
HTH.
--
Tsutomu Ogiwara from Japan.
_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com
It works beatifully.
----- Original Message -----
From: <H...@necbns.com>
To: <hk...@penguin.com.sg>; <le...@nja.co.za>; <inform...@iiug.org>
Sent: Thursday, July 11, 2002 10:19 AM
Subject: RE: Informix - load command
> Hi Yeo,
>
> You can use simple UNIX commands to add '|' at end of the line.
>
> cat filename | sed 's/$/\|/'
>
> -Hai
>
> -----Original Message-----
> From: Yeo Hwee Kiong [mailto:hk...@penguin.com.sg]
> Sent: Wednesday, July 10, 2002 5:54 PM
> To: Leon Pappadopoulos; inform...@iiug.org
> Subject: Re: Informix - load command
>
>
Thank you very much.
----- Original Message -----
From: "Tsutomu Ogiwara" <tsutomu...@hotmail.com>
To: <hk...@penguin.com.sg>; <le...@nja.co.za>; <inform...@iiug.org>
Sent: Thursday, July 11, 2002 10:59 AM
Subject: Re: Informix - load command
> Hi Yeo.
>
> Try the following.
>
> file b contains
> 1
> 2
> 3
>
> % nawk '{ printf ("%s|\n", $0);}' < b
> 1|
> 2|
> 3|
>
> % nawk '{ printf ("%s|\n", $0);}' < b > other file
>
> PS. If you use Solaris, use nawk. Else use awk.
>
> HTH.
>
> >From: "Yeo Hwee Kiong" <hk...@penguin.com.sg>
> >Reply-To: "Yeo Hwee Kiong" <hk...@penguin.com.sg>
> >To: "Leon Pappadopoulos" <le...@nja.co.za>, <inform...@iiug.org>
> >Subject: Re: Informix - load command
> >Date: Thu, 11 Jul 2002 08:53:32 +0800
> >