Header and Footer in sqlloader [message #71011] |
Mon, 26 August 2002 21:50 |
Arfat
Messages: 25 Registered: August 2002
|
Junior Member |
|
|
Hi evry 1
In data file i am having an Header and Footer which i want skip while loading to oracle through sql loader.
The header can be elimenated using skip=1 what abt footer is there any solution for it
|
|
|
Re: Header and Footer in sqlloader [message #71031 is a reply to message #71011] |
Wed, 28 August 2002 16:38 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
You can pre-process the file to trim off what you don't want.
This trims off the first 5 and last 3 lines off zz.txt and outputs to zz_new.txt
#!/bin/ksh
export TRIM_HEAD=5
export TRIM_TAIL=3
export LINES=`wc -l zz.txt | awk '{ print $1 }'`
echo Lines in zz.txt=$LINES
nawk -F "|" '{if(NR > ENVIRON[["TRIM_HEAD"]] && NR < ENVIRON[["LINES"]]-ENVIRON[["TRIM_TAIL"]]) print $0 }' zz.txt > zz_new.txt
|
|
|
Re: Header and Footer in sqlloader [message #71048 is a reply to message #71011] |
Sun, 01 September 2002 20:09 |
Arfat
Messages: 25 Registered: August 2002
|
Junior Member |
|
|
Hi andrew,
The processing of file statment u sended is for unix,
can i get something same which i can use it from DOS prompt to process the file as the oracle is on windows.
I will be really thankfull for that.
|
|
|