Hi,
I am a Perl beginner. I want to query a DB and output the result row by row to text files.
eg.
sr.no. Name CodeBlock
1. mail afdsklj
afdskj
adsfasfddsaf
2. abcd l;kk;k;oiewrj
werkdsmjudjem
werjhdsujnsl
afl;af;lweorpi
3. wxyz adskflasflkafdj
kajdsflkjadslkjfa
output should be 3 text files
namely mail with content
afdsklj
afdskj
adsfasfddsaf
abcd with content
l;kk;k;oiewrj
werkdsmjudjem
werjhdsujnsl
afl;af;lweorpi
and wxyz with content
adskflasflkafdj
kajdsflkjadslkjfa
.
I am getting stuck because my code block is of variable length.
The codeblock contains several new line characters, tab and several
other commonly used separators. Hence, I am using a shell script to query
the db. The shell script outputs my query result separated by a string "(_KJ_)".
I tried using while $sqlout regmatch "(_KJ_)" create file and
and copy content to file close file. but with this I get just the first file.
I am unable to get perl read till the end of the file.
Please Help
KJ..
In reply to export table to text. by kirtivardhan
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |