| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.misc -> Re: How to skip fields in input file ( SQLLOAD )
arivlin_at_my-deja.com wrote:
> I have table:
> create table A ( a int, b varchar2 (100) );
>
> My inpu file looks like
> 1^^abc
> 1^asd^sbd
> 1^dd11^123
> 1^123^123
>
> I need to import first and last fields from the file into columns a,b
> respectively.
>
> How do I skip second field in the file?
>
> Alex
>
> Sent via Deja.com http://www.deja.com/
> Share what you know. Learn what you don't.
Alex,
Try this . Let's have the input file name as input.lst. If u use a unix o/s , do the following from prompt that will eliminate both ur ^ symbol as well skip ur second field and create a new text file with just the first and third field that u could use to load into the database. Here is the single line script :-
cat input.lst | awk -F"^" '{printf "%d:%s\n",$1,$3}' > input1.lst
If u open the input1.lst it will have the first and the third field delimited by :, that u can use for loading into the db.
Thanks
Sai
Received on Tue Jun 22 1999 - 14:32:37 CDT
![]() |
![]() |