W
Wild Karl-Heinz
hi.
I have a bit of a problem
I'd like to do the following.
DATA = [
{ :fn => 'data.csv',
:sql => %q{ insert into table (id,name) values ('#{x[1]}','#{x[2]}' ); }
},
]
DATA.each { | d |
File.foreach( d[ :fn ] ) { | line |
x = line.chomp.split( /\t/ )
print( d[ :sql ] )
}
}
If I us %Q I get an name error x isn't defined and
if I us %q the x aren't expanded with the found values.
Some hits. Whould be great
regards
Karl-Heinz
I have a bit of a problem
I'd like to do the following.
DATA = [
{ :fn => 'data.csv',
:sql => %q{ insert into table (id,name) values ('#{x[1]}','#{x[2]}' ); }
},
]
DATA.each { | d |
File.foreach( d[ :fn ] ) { | line |
x = line.chomp.split( /\t/ )
print( d[ :sql ] )
}
}
If I us %Q I get an name error x isn't defined and
if I us %q the x aren't expanded with the found values.
Some hits. Whould be great
regards
Karl-Heinz