My requirement is that I've to read a config file having below info
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
Please advice. Thanks.
Actually from the XML file I am able to extract values for below variables:
Quote:
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
Changed config file:
To read only "Oracle" section from the file (searched forum)
In my script I'll have variables holding source & target datatypes as below: Scenario 1
Now as $src_datatype variable is "number" then I want to read only
this line from the temp.cfg
and check whether $tgt_datatype is either of them i.e. "double" or "interger"?
Scenario 2
If $src_datatype variable is "number(p,s)" then I want to read only
this line from temp.cfg
and check whether $tgt_datatype is "decimal" ?
I tried
but it selects two lines
Please advice on how to proceed further. Thanks for your time.
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)