|
|
|
|
|
|
|
|
|
|
Re: Is it possible to load data from a text file to other one text file using SQL LOADER? [message #251242 is a reply to message #251005] |
Thu, 12 July 2007 13:56 |
andrew again
Messages: 2577 Registered: March 2000
|
Senior Member |
|
|
http://www.akadia.com/services/ora_important_2000.html
search for "Useful UNIX Utilities to manipulate fixed length records"
awk, perl are commonly used for processing text files.
======================================================================
Split a data file
======================================================================
>cat t.dat
11 hello11
21 hello21
31 hello31
41 hello41
>cat t.ksh
#!/bin/ksh
# lines starting with 1 go to t1.txt
# lines starting with 2 go to t2.txt etc
while read i
do
awk 'substr($1,1,1) == 1 { print $1 > "t1.txt" }
substr($1,1,1) == 2 { print $1 > "t2.txt" }
substr($1,1,1) == 3 { print $1 > "t3.txt" }
substr($1,1,1) == 4 { print $1 > "t4.txt" }'
done < t.dat
|
|
|