This is for all of you who reply to my question THANK YOU!!!!! I follow your guidance and now I have a working _____
(here the question is it a script or a program?, must
forgive me my last programming tool was Korn shell and
AWK and sed so there it was always a script, here I
call them programs am I right or wrong?)


And once again THANK YOU ALL!!!



Please forgive my mistake, what i want is to send the same data with SELECT * INTO OUTFILE $filename FROM reg501 but with diferent filename, but every time it get cycle.
and the file names are a combination of the first column of patente and the week of the year
Good Morning !!
Guys I have a problem at my hands, I am working on getting
a very specific filename, I have a CSV file that has
this data:
patentes,nombre,email 1458,juan armando,armandogomezguajardo@gmail.com 2500,Armando Guajardo,a8688165026@prodigy.net.mx 3500,AAA,armando.gomez@aaahmt.com 4500,padawan,padawanlinuxero@gmail.com
Let me explain a bit the file the first column is an ID, the second column
is the name of the company and the third is the email of the company
with these file I extract the first column and the third one too
with the first column I must do a combination to give a file name
so I open the CSV file and send to an array the first column,
then I get the week of the year just the number, with that
form a file name for the data,
now I have a file name with that I do a SELECT * INTO OUTFILE $filename
But evey time it just get cycle I dont know why can you help me
here is the full code:
#!usr/bin/perl use strict; use DBI; use Date::WeekOfYear; use Mail::Sender; my $dbh = DBI->connect("DBI:CSV:f_dir=/dbf2csv/") or die "Cannot connect: " . $DBI::errstr; my $sth = $dbh->prepare("SELECT * from patentes.csv") or die "Cannot prepare: " . $dbh->errstr(); $sth->execute() or die "Cannot execute: " . $sth->errstr(); while (my $row = $sth->fetch) { # print "\n@$row[2]\n"; # print "\n@$row[1]\n"; # print "\n@$row[0]\n"; my @date = localtime(time); #my $date = sprintf("%4d%2d%2d",1900+$date[5],$date[4],$date[3]); my $weekNo = WeekOfYear(); # this replaces the spaces with 0's #$date =~ s/\s/0/g ; # now we can make a filename my $filename = 'sem'.$weekNo.@$row[0].'data.csv'; print "\n$filename"; # Now in these part we make the information drop to csv or something l +ike that my $sql = "SELECT * INTO OUTFILE 'g:/dbf2csv/$filename' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' FROM reg501"; # Now we're all set to go my $sth = $dbh->prepare($sql); $sth->execute (); }
Please can you help me guys??? thanks

In reply to Urgent help !!!! by padawan_linuxero

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.