From: Wild Karl-Heinz Date: 2004-12-17T23:57:24+09:00 Subject: String expand problem 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