Hi I am kinda new to Perl, Its going to sound dumb but, my CSV_Handle which one is it these is the code:
# create the sql select statement my $sql = "SELECT * INTO OUTFILE 'c:/proyecto/$filename' FIELDS TERMINATED BY ',' LINES TERMINATED BY '\r\n' FROM t3132"; my $sth = $dbh->prepare($sql); $sth->execute (); $sth->finish (); $dbh->disconnect (); my $Excel = Win32::OLE->GetActiveObject('Excel.Application') || Win32::OLE->new('Excel.Application', 'Quit'); #------ Abro el archivo CSV y lo dirijo al primera hoja de trabajo --- +-- my $Book = $Excel->Workbooks->Open("c:\\proyecto\\$filename"); my $Sheet = $Book->Worksheets(1); print $filename ",,,,,\n"; #------ Busco las ultimas celdas usadas en la hoja de trabajo ------ my $LastRow = $Sheet->UsedRange->Find({What=>"*", SearchDirection=>xlPrevious, SearchOrder=>xlByRows})->{Row}; my $LastCol = $Sheet->UsedRange->Find({What=>"*", SearchDirection=>xlPrevious, SearchOrder=>xlByColumns})->{Column}; #------ Imprimo en pantalla los valores ------- print "Ultima Columna:\n"; print "$LastCol\n"; print "Ultimo renglon:\n"; print "$LastRow\n"; #------ Ahora busco las celdas de la hoja de excel ----- #en este caso dejo la primera linea sin contar porque es la de los enc +abezados my ($Start_col, $Num_Cols,$End_col) = ('A', $LastCol, 'A'); ++$End_col while --$Num_Cols; my ($Start_row, $Num_rows) = (4, $LastRow); my $End_row = $Start_row + $Num_rows - 1; my $Range_str = "$Start_col$Start_row:$End_col$End_row"; #------ Imprimo los valores ----------- print $Start_col; print $Start_row; print $End_col; print $End_row; print "Fin de busqueda de los datos"; my $range2 = $Sheet->Range($Range_str); $range2->AutoFormat(7);
thanks

In reply to Re^4: Insert blank rows in a CSV by ArmandoG
in thread Insert blank rows in a CSV by ArmandoG

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.