Script fro file check and load the trail file


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Script fro file check and load the trail file
# 1  
Old 10-24-2016
Script fro file check and load the trail file

Hi,

Im going to use shell script for load the data into DB.

First i need to read the trail file(csv file has two columns with comma separated ) like file name trail1024(last 4 digitsMMDD).

In this trail file 27 entries will have like below,I need to read first csv file name and get the 4 digit number(ex 1024 from file name below) from file name and need to keep the variable.

Code:
abcd1024.csv,23
defg1024.csv,55
....

Then i need to loop through the all files names from tail file and need to check the all file are exists or not in directory.
If any file is not found in directory need to exist from shell script and throw error.

If files are exists i need to call oracle function called loaddata.

Please help on this shell scripts

Moderator's Comments:
Mod Comment Please use CODE tags as required by forum rules!

Last edited by RudiC; 10-24-2016 at 09:05 AM.. Reason: Added CODE tags.
# 2  
Old 10-24-2016
Any attempts/ideas/thoughts from your side? Any preferred tools?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to load XML file to Oracle table

Experts. I have created a oracle table as below. create table xml_tab ( File_No number , File_content Varchar2(2000), file_type xmltype ); Daily we are receiving many XML files as below. here is our sample xml file. File1 : (7 Replies)
Discussion started by: vasuvv
7 Replies

2. Shell Programming and Scripting

How to read file and load data into a script as variable

I need to read a text file that contain columns of data, i need to read 1st column as a function to call, and others are the data i need to get into a ksh script. I am quite new to ksh scripting, i am not very sure how to read each row line by line and the data in each columns of that line, set... (3 Replies)
Discussion started by: gavin_L
3 Replies

3. Shell Programming and Scripting

Script to check for the file existence, if file exists it should echo the no of modified days

Hi, I am looking for a shell script with the following. 1. It should check whether a particular file exists in a location #!/bin/sh if ; then echo "xxx.txt File Exists" else echo "File Not Found" fi 2. If file exists, it should check for the modified date and run a command... (2 Replies)
Discussion started by: karthikeyan_mac
2 Replies

4. Shell Programming and Scripting

Perl script to Archive the data file after the load

I have written a perl scripts which loads the data. Now i want to modify the script, to Archive the Input file after the successful load of data. Can anyone please share it and help me .... Thanks. (2 Replies)
Discussion started by: msrahman
2 Replies

5. Web Development

script to load data from csv file

hello i want a script to load the data line by line from a csv file into a mysql table (3 Replies)
Discussion started by: srpa01red
3 Replies

6. Shell Programming and Scripting

script fro profile

Hi I need to restrict one user to see only his directory and one more directory how i can do this in his profile. The OS is Red hat linux I create a user -- tec and group calle --tec the user need to see /opt/tec and he is able to change directory to all subdiretories under tec... (1 Reply)
Discussion started by: aboorkuma
1 Replies

7. Shell Programming and Scripting

Perl script to load text file into DB field

Hello, maybe this post is offtopic, sorry for the inconveniencies (maybe should be in the forum with questions about C, C++, Java, SQL...). I found examples about how to populate different fields from a text file (with MySQL, the LOAD DATA INFILE sentece), but not about how to load a complete... (2 Replies)
Discussion started by: aristegui
2 Replies

8. Shell Programming and Scripting

Check File Exists and compare to previous day file script

We have data files that are ftp'd every morning to a SUN server. The file names are exactly the same except for that each has the date included in its name. I have to write script to do 2 things: STEP 1) Verify that the file arrived in morning. STEP 2) Compare the file size of the current... (3 Replies)
Discussion started by: rbknisely
3 Replies

9. Shell Programming and Scripting

how to create new dir fro a file list

Hi, What will be the best way to do the follwing: i have a file calld dir.list /cav /cav/brif /usr/main /cat i want to run a script that will take each of the item in the file and create a new dir in a location that i'll choose it nee to do mkdir cav mkdir cav cd cav mkdir brif... (8 Replies)
Discussion started by: banjo
8 Replies

10. Shell Programming and Scripting

Shell Script to Load data into the database using a .csv file and .ctl file

Since i'm new to scripting i'm findind it difficult to code a script. The script has to be an executable with 2 paramters passed to it.The Parameters are 1. The Control file name(.ctl file) 2. The Data file name(.csv file) Does anybody have an idea about it? :confused: (3 Replies)
Discussion started by: Csmani
3 Replies
Login or Register to Ask a Question