My requirement is that I've to read a config file having below info
Code:
Oracle
number|double;integer -> user can put multiple values here
blob|binary
varchar2|string
varchar|string
number(p,s)|decimal
timestamp|date/time
and so on ....
Sybase
bigint|bigint
datetime|date/time
money|decimal
smallint|small integer
and so on ....
In the script I take a XML file as an input and extracts the source database and source & target tables' field's datatype info as below:
Quote:
$src_database - variable could have values as "Oracle", "Sybase", "Teradata",etc
$src_datatype - variable could have values as "number", "timestamp", etc (for Oracle) & "money", "smallint",etc (for Sybase) from SOURCE table
$tgt_datatype - variable could have RHS values as shown in config file from TARGET table
What I want to achieve is that
Code:
if $src_database = "Oracle" ;then
read only Oracle section of the config file
if $src_datatype = "number"; then
get the right hand side value i.e. "double" & "integer" and check if
either of the value matches with the $tgt_datatype then
echo "matches"
else
echo "doesn't match"
fi
fi
Note: I cannot paste XML file content as it's client info.
What I want now is to check if number = double is fine?
This translation I can read from config file only. Hope I'm clear now. Sorry for the confusion my initial post created.
-dips
---------- Post updated 2011-04-15 at 12:15 PM ---------- Previous update was 2011-04-14 at 02:23 PM ----------
Hi,
I'm able to read a section of file by changing the format of the file a little
Hi Gurus,
I have below file which has different sections, need to move the sections to beginning of the each record.
original file
aaa
bbb
ccc
ddd
eee
fff
output file.
aaa
bbb
ccc
ddd
eee
fff (6 Replies)
Hello,
I need to know all IP range (ip_prefix), associated with us-west-2 region only from this link - https://ip-ranges.amazonaws.com/ip-ranges.json (it can be opened in wordpad for better visibility)
Please suggest, how would I do it. If vi, awk or sed is needed, I have downloaded it on my... (7 Replies)
In the below, I am trying to lookup $1 and $2 from file1, in a range search using $1 $2 $3 of file2. If the search key from file1 is found in file2, then the word low is printed in the last field of that line in the updated file1. Only the last section of file1 needs to be searched, but I am not... (6 Replies)
i have a file as below that has n section :
2006 0101 1236 49.3 L 37.902 48.482 0.0 Teh 5 0.2 2.7LTeh 1
GAP=238 E
Iranian Seismological Center, Institute of Geophysics, University of Tehran 6
... (5 Replies)
I have a list of Servers in no particular order as follows:
virtualMachines="IIBSBS IIBVICDMS01 IIBVICMA01"And I am generating some output from a pre-existing script that gives me the following (this is a sample output selection).
9/17/2010 8:00:05 PM: Normal backup using VDRBACKUPS... (2 Replies)
Hi,
I have a text file 10giga size.
Opening the file with vi takes forever ...
Im intersting only with the 100 first records.
Is there way to copy those 100 lines to new file (with no need to open the file)?
Thanks (6 Replies)
hello all,
I have a file like this:
section 1
blah1
blah2
section 2
blah1
blah2
section 3
blah1
blah2
and I want to use sed to duplicate section 2, like this:
section 1
blah1
blah2
section 2
blah1
blah2
section 2
blah1 (2 Replies)
Hi, I am n00b to shell scripting and I am learning Ksh, sed and awk. I have a requirement and need your help.
1) How to read a specific section of a file. I have a file and I want to read the contents between say "Page Number:1" to "End of Page 1"
2) Within the section of the file that was... (2 Replies)
hi,
I have a 20 line file.
I need a command which will brinf back a specific line based upon the line number I enter.
e.g. the file looks like this and is called file1
jim is a man
john is a woman
james is a man
wendy is a woman
lesley is a woman
i want a command that will... (4 Replies)