Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Windows platform question

by fauria (Deacon)
on Aug 12, 2008 at 11:37 UTC ( #703871=perlquestion: print w/replies, xml ) Need Help??
fauria has asked for the wisdom of the Perl Monks concerning the following question:

Hi monks!

Im not very used to work with MS systems, and i need to write a script that exports Excel files to plain text.

This may be a silly question, but im not really sure:

Can i write a program, complile it with perlcc to a win32 binary, and place it in the Sendto folder (whatever it is named) and use the Send to context menu of an Excel file to pass it, so i can handle it through @ARGV?
Do you know if it will work when selecting many files?

Thanks so much.

Replies are listed 'Best First'.
Re: "Send To" Perl script in Windows (was: Windows platform question)
by ikegami (Pope) on Aug 12, 2008 at 11:47 UTC

    No, because perlcc has never worked and doesn't exist for new versions of Perl.

    But you can accomplish what you want with a trivial batch file.

    @echo off :: This is "parse_excel.bat" perl "C:\Path To\" %1 pause

    Place the batch file in the same directory as the .pl (or wherever you want) and create a shortcut (named however you want) to it in the "Send To" folder.

    Update: Switched to more representative file names.
    Update: You could even use pl2bat to convert your .pl into a batch file.

      I missed your desire for it to work with multiple files. Use %* instead of %1 in the batch file.
      @echo off :: This is "parse_excel.bat" perl "C:\Path To\" %* pause

      The names of the selected files will be present in @ARGV

      for my $xl_file_name (@ARGV) { ... }

      perlcc has never worked

      It worked a little in 1996... I used it for some small things... But even back then, people warned you away from it.


Re: Windows platform question
by marto (Bishop) on Aug 12, 2008 at 11:45 UTC
Re: Windows platform question
by Bloodnok (Vicar) on Aug 12, 2008 at 13:31 UTC
Re: Windows platform question
by SilasTheMonk (Chaplain) on Aug 12, 2008 at 13:20 UTC
    I believe there is a Spreadsheet::ParseExcel module. Why not use that?
Re: Windows platform question
by okram (Monk) on Aug 12, 2008 at 20:42 UTC
    I've answered a similar question on node 652223

    Basically, with ActiveState Perl, and using PAR::Packer. You do get an EXE.

    "Send To" passes the file name as arguments: you should get them on @ARGV.
    Check cpan xls2csv for a simple xls to csv "translator".
    What you might want to do in your program is to save the CSV or TSV or whatever file you need in the same folder as the file that has been passed via @ARGV.

    Please do let us know how that went ;)
Re: Windows platform question
by strat (Canon) on Aug 13, 2008 at 06:46 UTC

    Perhaps Re: excelPerl V0.13 released might help you: -begin "use Text::CSV_XS; $csv = Text::CSV_XS->new( { binary => 1} + )" -ane "$csv->combine(@F); print $csv->string, $/" -f file.xls

    (Just put it all in one line)

    Best regards,
    perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8."

Re: Windows platform question
by Tux (Abbot) on Aug 18, 2008 at 17:27 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://703871]
Approved by marto
Front-paged by ikegami
[corenth]: I'm a pragmatic free-software advocate. I'll play in a walled sandbox when I need to.
[erix]: hm, there's a FANN perl module - looks a bit old
[Cosmic37]: I'm afraid I don't know the answer to your map question...... what were the references too?
[corenth]: each reference was to a fairly small scaler.
[corenth]: I mean, array of scalers. usually triples.
[Cosmic37]: there is a FANN discussion group but seems to have gone quiet... http://leenissen. dk/fann/forum/ viewforum.php?f=18 &sid=1afc1fb3fa1a3 7f52b03e40d05cdaaa 3

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (7)
As of 2018-02-20 18:29 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (274 votes). Check out past polls.