texuser74 has asked for the wisdom of the Perl Monks concerning the following question:
With the following code i have written, nothing is happening.test.txt This is an example section. And the second line has structural science. jabb.mdb full | abb ------------- example | eg expand | exp section | sect science | sci test.out (required output) This is an eg sect. And the second line has structural sci.
please help me in looping through the files.use Win32::ODBC; open( IN, '<', 'test.txt' ) or die "Couldn't open infile.\n$!"; open( OUT, '>', 'test.out' ) or die "Couldn't open outfile.\n$!"; $dsn = "test_dsn"; $db = new Win32::ODBC($dsn); die "ERROR: Failed to open database\n" if(!$db); $sql = "SELECT * from jabb"; $db->Sql($sql); while ($db->FetchRow()) { ($full, $abb) = $db->Data("full", "abb"); while(IN){ s!$full!$abb!g; print $_; print OUT $_; } close(OUT); } $db->Close();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: working with files
by davido (Cardinal) on Nov 02, 2005 at 08:54 UTC | |
by texuser74 (Monk) on Nov 02, 2005 at 09:04 UTC | |
by davido (Cardinal) on Nov 02, 2005 at 09:14 UTC |