RE: Import Command

RE: Import Command

 

  

Rahul,

What Detlev said for Unix holds true for Windows as well. If you only have 4 lines in your file, open the file in an editor and manually create a single row. However, if you're looking for a technique that will handle a file of unknown number of lines, I'd recommend importing the file to a table, then writing a stored procedure that will reformat four lines into one line and insert that to your real target table. I'm sure there are other ways to handle this problem too, this is just one.

Nick

-------------- Original message --------------
From: "Singh Rahul " <db2udbdba-ezmlmshield-x25959637.[Email address protected]

> I forgot to mention, I am on windows.
> Can there be any workaround on windows ?
>
> --Rahul Singh
>
>
> -----Original Message-----
> From: d [mailto:db2udbdba-ezmlmshield-x76174925.[Email address protected]
> Sent: Tuesday, December 26, 2006 5:13 PM
> To: LazyDBA Discussion
> Subject: Re: Import Command
>
> Hi,
>
> no, there is no such option for IMPORT.
> But it is no problem to write a small script that is putting 4 lines
> into one.
> Try this (for UNIX):
>
> > awk 'BEGIN{i=1}{printf("%s;",$1); if (i==4) {i=1;printf("\n")}else
> {i++} }' file.txt>out.txt
>
> Cheers
>
> Detlev
>
> Am Dienstag, 26. Dezember 2006 10:27 schrieb Singh Rahul:
> > I am having a file having four rows as
> > 2342
> > 234234
> > 345
> > 234253
> > Now I want to import them in a table so that all four lines goes
> > into 4 different columns(A,B,C,D) in a single row in a table. Is
> > there any option in Import Command ?
> >
> > Regards
> > Rahul Singh
> >
> >
> >
> > -------------------------------------------------------------------
> >-- TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY To
> > post a dba job: http://jobs.lazydba.com
> > To Subscribe : http://www.LazyDBA.com
> > To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
> --
> Eine besinnliche Weihnachtszeit und
> einen guten Start ins neue Jahr wünscht
>
> Detlev Kuntze
>
> Das Tauschforum Stuttgart im Internet:
> http://www.tauschforum-stuttgart.de
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To post a dba job: http://jobs.lazydba.com
> To Subscribe : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>
>
>
>
> ---------------------------------------------------------------------
> TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
> To post a dba job: http://jobs.lazydba.com
> To Subscribe : http://www.LazyDBA.com
> To unsubscribe: http://www.lazydba.com/unsubscribe.html
>

DB2 & UDB email list listserv db2-l LazyDBA home page