Naveen_learn has asked for the wisdom of the Perl Monks concerning the following question:
##################################### I need to print each column of table in to different columns of the excel.I have to modify this program to get a below output.my $file_name="/source_file/source_file.txt"; print LOG "Opening the file \n"; open(SRC_FILE,">$file_name")|| die "Can't open $file_name\n"; print SRC_FILE "USER_ID,USER_NAME,PRIMARY_GROUP,EMAIL \n"; $sql = "SELECT user_id,user_name,primary_group,email from users"; my $sth=$db->prepare($sql); $sth->execute || die "Can't execute the query\n"; while (@row =$sth->fetchrow_array) { print SRC_FILE "$$row[0][0]" \n"; }
I have searched the questions of this kind in this site but all in vain. please help me out.USER_ID USER_NAME PRIMARY_GROUP EMAIL abcd arun app_dev arun@abc.com pvad rani consultant rani@abc.com
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl Program to load set of columns of table into excel
by code-ninja (Scribe) on Aug 26, 2013 at 09:40 UTC | |
|
Re: Perl Program to load set of columns of table into excel
by soonix (Chancellor) on Aug 27, 2013 at 09:02 UTC |