01-07-2013
Looping a flat file and loading data
Hi, I am very new to UNIX environment. And I am stuck in this problem.
In my Unix server, I have a file called "tablelist.txt" which gives me a list of the tables in my oracle database like shown below.
bmp.table1
bmp.table2
bmp.table3
:
:
bmp.table20
All these tables have 'batch_id' column.
Now i need a Unix script which will loop through each line of tablelist file. and extract the data from each table for that batch_id and load into separate files.
At the end of the process, i should have 300 files which has records of 300 tables.
Note: I am using SQLPLUS In Unix server.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have used this forum many times to solve my many scripting problems. This time, I would like to seek some answers to a problem that I've been head scratching quite a bit on.
My Example:
I am converting a 2000-byte file into a 300-byte file
this file has no delimiters and hardly any... (3 Replies)
Discussion started by: oott1
3 Replies
2. Shell Programming and Scripting
Hi All,
I am trying to load a data from a files in a particular directory to a database..
cd $SCC
isql metdb >> ${LOGDATA}/LOAD.LOG < !
load from "${LDATA}/${FORM}.ld" insert into $LOADTABLE
!
But it's showing the error "syntax error at line 46 : `<<' unmatched"
Can u plz help me... (5 Replies)
Discussion started by: grajesh_955
5 Replies
3. Shell Programming and Scripting
Hi
I would like to know how to load oracle data to unix flat file using a shell script.
Can we use sqlldr to import data from oracle, if so can anyone help me with it. (2 Replies)
Discussion started by: raghav288
2 Replies
4. Shell Programming and Scripting
I have a flat file with records like
Header
123 James Williams Finance2000
124 Pete Pete HR 1500
125 PatrickHeather Engg 3000
Footer
The structure is:
Eno:4 characters
Name:8 characters
Surname : 9 characters
Dept:7 characters
Sal:4characters
These are sample... (1 Reply)
Discussion started by: Shivdatta
1 Replies
5. Shell Programming and Scripting
Hi everyone!!
I need help regarding this.
How can we load data from DB2 Database tables into a Comma Separated File?
I also have another Question? Using Shell scripting, Is it easy to read Data from a table or from a text file?
It is very urgent for me. Please help me out guys.
... (1 Reply)
Discussion started by: ss3944
1 Replies
6. Shell Programming and Scripting
I have a file something like this:aaaa.xml content of the file is
0,<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<storeInformation xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<s>
<BRANCH_NO>3061</BRANCH_NO>
<BRANCH_NAME>GREEN EXPRESS</BRANCH_NAME> ... (4 Replies)
Discussion started by: kmanivan82
4 Replies
7. Shell Programming and Scripting
I have a requirement to read the xml file and split the files into two diffrent files in Unix shell script. Could anyone please help me out with this requirement.
Sample file
---------------
0,<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<Information... (3 Replies)
Discussion started by: kmanivan82
3 Replies
8. Shell Programming and Scripting
Help needed (1 Reply)
Discussion started by: Chand Shrestha
1 Replies
9. Shell Programming and Scripting
Hello,
please help me an the below issue.
i need to check whether data is available or not in a flat file generated by oracle
(sometimes sql didn't any records) to overcome this.
without opening flat file.
Thanks....... (1 Reply)
Discussion started by: mahesh1987
1 Replies
10. Shell Programming and Scripting
Hi,
I have a flaty file from which i am fetching few columns in tablular form as below code.
Now i want to fetch the column 6 and 7 in below code only if it either of them is non zero.However below startement
awk -F, '$6==0 && $7==0{exit 1}' ${IFILE}
is not working..Not sure where is the... (36 Replies)
Discussion started by: Vivekit82
36 Replies
LEARN ABOUT OPENDARWIN
niload
NILOAD(8) System Manager's Manual NILOAD(8)
NAME
niload - load text or flat-file-format data into NetInfo
SYNOPSIS
niload [ -v ] [ -d ] [ -m ] [ -p ] [ -t ] { -r directory | format } domain
DESCRIPTION
niload loads information from standard input into the given NetInfo domain. If format is specified, the input is interpreted according to
the flat-file file format of the same name. The allowed values for format are aliases, bootparams, bootptab, exports, fstab, group, hosts,
networks, passwd, printcap, protocols, rpc, and services.
If -r directory is specified instead of a flat-file file format, the input is interpreted as "raw" NetInfo data, as generated by nidump -r,
and loaded into directory. Note that this operation will delete and replace the entire NetInfo subtree at the specified directory. Any
existing records in this subtree will be lost.
niload overwrites entries in the existing directory with those given in the input. Entries that are in the directory aren't deleted if
they don't exist in the input, unless the -d option is specified. niload must be run as superuser on the master NetInfo server for the
given domain, unless one specifies the -p option, which allows one to run from anywhere in the network.
OPTIONS
-v Verbose. Prints details of records as they are updated (flat-file formats only).
-d Delete entries which are in the directory, but not in the input.
-m Merge properties and values. Existing properties will be preserved in the database if they are not present in the input. For exam-
ple, if a user record has a "picture" property, loading a passwd-format record for this user will preserve the property. Property
values are also merged.
-p Prompt for the root password of the given domain so that one can run from other locations in the network besides the master.
-t Interpret the domain as a tagged domain. For example, "trotter/network" refers to the database tagged "network" on the machine
"trotter". The machine name can be an actual name or an IP address.
-r Load entries in "raw" format, as generated by nidump -r. The first argument should be the path of a NetInfo directory into which
the information is loaded. Since the input often specifies properties (including "name") at its topmost level, the directory you
specify may be renamed as a result of this operation. If the directory you specify does not exist, it will be created.
EXAMPLES
"niload passwd . < /etc/passwd" loads the local /etc/passwd file into the local NetInfo database.
"niload -d -r /locations ." replaces the contents of /locations in the local domain with input given in nidump "raw" format.
SEE ALSO
nidump(8), niutil(8), netinfo(5), aliases(5), bootparams(5), bootptab(5), exports(5), fstab(5), group(5), hosts(5), networks(5), passwd(5),
printcap(5), protocols(5), rpc(5), services(5)
Apple Computer, Inc. December 22, 1992 NILOAD(8)