Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading parameter file 1

Status
Not open for further replies.

Filipvdr

Programmer
Mar 11, 2010
25
BE
Hello, i'm new at this so this could be a stupid question.

So i need to read parameters out of a file

paramater.txt looks like this:
user = OWBREPOS
paswoord = OWBREPOS
host = Filip
service = FILIP2
project = MY_PROJECT
moduleA = BI_module

it should be
$user with value OWBREPOS
$host with value Filip

thanks in advance
 
well, in my program Oracle Warehouse Builder you got the following tree:

My_Project
DWH_Module
Mappings
DIM_CUSTOMERS_FRANCE
BI_MODULE
TEST_MODULE

in text parameter file i ask modules,mappings
[MODULE VARIABEL]

modules = DWH_MODULE BI_MODULE TEST_MODULE

################################################################################
# MAPPINGS #
################################################################################
[MAPPING VARIABEL]

maps = DIM_CUSTOMERS_FRANCE_MAP

BUT, this mappings only is situated in the DWH_MODULE, and not in the other ones.

But according to my output now, my code is wrong. I need some kind of check to say that mapping belongs to that module.
 
Hi

Sorry, to many unknown things. I have no idea what that tree is and what you want to do with it.

I can help you only with simple processing things : you show the data, specify the needed result and enumerate the rules that applies.

But I am completely lost in this special environment. :-(

Feherke.
 
no problem, i'm figuring it out but i got stuck by a simple thing and you are the guy that can help me

it it's quite simple, i've got 2 lists now
a list of all mappings in a module
a list of all variables i entered in parameter file ( modules = MOD_A MOD_B ...

now i'm trying to compare them, if they are equal i write them out. But i don't know if i compare them right

for {set loopmod 0} {$loopmod<[llength $conf(modules)]} {incr loopmod} {
# puts "$loopmod : [lindex $conf(modules) $loopmod]"
set modulevar [lindex $conf(modules) $loopmod]
OMBCC '$modulevar'
# check how long my variable maps is, if larger then 0, they have selected specific mappings,.
if {[llength $conf(maps)] > 0} {
for {set i 0} {$i<[llength $conf(maps)]} {incr i} {
# puts "$i : [lindex $conf(maps) $i]"
# check if map is in module
set Checklist [OMBLIST MAPPINGS]
set loopmapcheck 1
foreach mapCheckName $Checklist {
# loop through all mappings in module
# compare them with ALL variables in list
# if mapname = one of the parameter list then reconcile
if {[string compare [$mapCheckName] [lindex $conf(maps) $i] ] == 0 }
puts "[lindex $conf(maps) $i]"
incr loopmapcheck
}
# puts " reconciling: $mappingName"

puts " reconciling: [lindex $conf(maps) $i]"
}
# no maps specified: reconcile all maps
} else {
set Mappinglist [OMBLIST MAPPINGS]
set loopmap 1
foreach mappingName $Mappinglist {
puts " reconciling: $mappingName"
incr loopmap
}
}
OMBCC '..'
}

 
hello, long time, i got a question

in parameter file

modules = MODULE_A MODULE_B

but every module can have different locations, can i do the follwoing

in the parameter file make a var with the names of the module

MODULE_A = LOCATION_1 LOCATION_2 LOCATION_3
MODULE_B = LOCATION 1 LOCATION 4


for {set loopmod 0} {$loopmod<[llength $conf(modules)]} {incr loopmod} {
set mod_name [lindex $conf(modules) $loopmod]
if {[string compare $mod_name mod_name] } {
do something
}

}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top