Home » Infrastructure » Unix » how to load multiple files into 1 table using unix script
how to load multiple files into 1 table using unix script [message #149265] Wed, 30 November 2005 21:58 Go to next message
anil_apps
Messages: 34
Registered: November 2005
Location: India
Member

i am new in unix
i have a lot if files which commpressed
i want to uncommprese each file and load in to table and pick up new file in directory and do the same thing upto files are completed
can anybody help me
Re: how to load multiple files into 1 table using unix script [message #149284 is a reply to message #149265] Thu, 01 December 2005 00:28 Go to previous messageGo to next message
anil_apps
Messages: 34
Registered: November 2005
Location: India
Member

thanks for script
but what i what is
1. directory having 100's file
2.picup one file and uncompres
3.load data from flat file to table.
4.picup another file from dir..
5.load into table
6.until files are comleted
7.dont insert last record into table becuse it has
some trailer information

plz...give comlete code bez. i am new to unix
Re: how to load multiple files into 1 table using unix script [message #149296 is a reply to message #149284] Thu, 01 December 2005 01:40 Go to previous messageGo to next message
Maaher
Messages: 7065
Registered: December 2001
Senior Member
I split your topic from this one:
Help me ...spent a long time on this issue

I'm afraid Tarun's answer was referring to the other post, not yours.

MHE
Re: how to load multiple files into 1 table using unix script [message #149340 is a reply to message #149296] Thu, 01 December 2005 05:33 Go to previous message
tarundua
Messages: 1080
Registered: June 2005
Location: India
Senior Member

No one will you provide you the entire solution unless you are not willing to do anything on your own.

I can give you the logic but you have to implement it.


1. ls -l /your_directory | awk ' { print $9}' > result_file

Now this result_file will contain the name of all the files in the directory.

Read that file

2. cat result_file | \
while read filename
do
uncompress $filename
--- you can use loading script here after uncompressing
done

hope it will help you.


Previous Topic: database not shutting down
Next Topic: Help needed with decompress of .gz file
Goto Forum:
  


Current Time: Fri Nov 29 01:09:44 CST 2024