Re: load a table with some null lines
Answered: amber (solid confidence) — Gary Quiring's dbload error 846 from blank lines in a print file gets concrete workarounds: raise dbload's -e error tolerance, or (best) fix the tr/CR-LF handling and use HPL for the stated volume of 3000 files/day.
Advisory only.
Posted in 2001
Topics: General Discussion
Couldn't you just clean up the data first? grep -v '^$' tab1.unl > tab2.unl or add a pipe "|" at the end? Gary Quiring wrote: > > I'm trying to load a print file into a table. The print file does not have > any control characters, but it does have some lines with just line feeds > and no data. I keep getting ' 846: Number of values in load file is not > equal to number of columns.' > > I just want to declare a 132 char variable and bring in each print line. > Is there a way of loading the data and not using TEXT as the type. > > Thanks > Gary Quiring > > > -- Colin Any opinions I state are my own and not necessarily those of my employer
On Wed, 3 Jan 2001 12:26:01 -0500 (EST), Colin McGrath <cmm@trac3000.ueci.com> wrote: > >Couldn't you just clean up the data first? > >grep -v '^$' tab1.unl > tab2.unl > >or add a pipe "|" at the end? We currently did a tr and changed the new line to a pipe. But I would really like to know how to load the data without constantly running a unix script. This is not a one time deal, we have a need to parse about 3,000 print files per day. Thanks Gary >Gary Quiring wrote: >> >> I'm trying to load a print file into a table. The print file does not have >> any control characters, but it does have some lines with just line feeds >> and no data. I keep getting ' 846: Number of values in load file is not >> equal to number of columns.' >> >> I just want to declare a 132 char variable and bring in each print line. >> Is there a way of loading the data and not using TEXT as the type. >> >> Thanks >> Gary Quiring >> >> >>
Hi!
I think if you set the number of allowable errors in dbload high enough
it will give you error (and log it), but it will continue.
dbload .... -e 10000 .....
HTH
Michael
Gary Quiring wrote:
> On Wed, 3 Jan 2001 12:26:01 -0500 (EST), Colin McGrath
> <cmm@trac3000.ueci.com> wrote:
>
> >
> >Couldn't you just clean up the data first?
> >
> >grep -v '^$' tab1.unl > tab2.unl
> >
> >or add a pipe "|" at the end?
> We currently did a tr and changed the new line to a pipe. But I would
> really like to know how to load the data without constantly running a unix
> script. This is not a one time deal, we have a need to parse about 3,000
> print files per day.
>
> Thanks
> Gary
>
> >Gary Quiring wrote:
> >>
> >> I'm trying to load a print file into a table. The print file does not have
> >> any control characters, but it does have some lines with just line feeds
> >> and no data. I keep getting ' 846: Number of values in load file is not
> >> equal to number of columns.'
> >>
> >> I just want to declare a 132 char variable and bring in each print line.
> >> Is there a way of loading the data and not using TEXT as the type.
> >>
> >> Thanks
> >> Gary Quiring
> >>
> >>
> >>
Gary Quiring wrote in message ... >On Wed, 3 Jan 2001 12:26:01 -0500 (EST), Colin McGrath ><cmm@trac3000.ueci.com> wrote: > >We currently did a tr and changed the new line to a pipe. But I would >really like to know how to load the data without constantly running a unix >script. This is not a one time deal, we have a need to parse about 3,000 >print files per day. If you are able to use tr as part of the load process (and why would that NOT be possible?) then you are also quite able to use perl, awk or whatever. So, your question is piss-easy to answer. By the way, if u use tr to change the newline into a | then where do you get a newline character from that is required by the load operation??? Are you in fact processing DOS or Windows files where you can afford to change CR-LF into | LF ? If so, consider changing the CR to | using tr and leave the LF alone. CR is ascii 13, or \\015 in tr language. If you know your max data line will be 132, then declare a char(132) in the receiving table. Make sure each line from the reports is processed with perl or awk to add a | at the end. Make sure the report NEVER puts a \\ or | into the text! If it does, you will need to modify your massaging operation to add a \\ in front of all \\ or | that already exist in the reports. Once the files are ready, you should be able to fly. Since you say you have to load 3000 reports a day, consider also using the High Performance Loader (HPL) because it is capable of reading from programs, which could be either the report processes themselves, or the perl/awk process which is doing the cleanup work. Actually, since I know sod-all about the HPL (i'll get round to using it real soon now) it may well be capable of doing all the cleanups required. Good luck on your mission.