Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Re: csv output

by oubiwann (Sexton)
on Mar 15, 2002 at 06:52 UTC ( [id://151925]=note: print w/replies, xml ) Need Help??


in reply to Re: csv output
in thread csv output

You know, I find this absolutely incredible:

I was given a negative marking on this post!

Is this not a community of Fellowship? Should we not work together to better ourselves? Was my intention not clearly one of helpfulness?

Why then, the need to lash out? Why can't it be a hand of friendship instead of a hand that seeks to damage?

Replies are listed 'Best First'.
Re: Re: Re: csv output
by Anonymous Monk on Mar 15, 2002 at 07:05 UTC
    Perhaps its because you told Toni to chill out. Toni hasn't posted a single node in this thread except for the original question....
      Then I was completely misunderstood. Look at the threads here - people were criticizing each other's methods. Here's what I was trying to say:

      Hey Toni, it's all tense in here; people are treating this like life and death - when you read this, don't let it reflect on you or your question - just relax, take it with a grain of salt, and come back to us.

      It was precisly for the reason that s/he hadn't posted that I wanted to make this person feel welcome. Was the nature of my post such that it made sense for me to say "hey, man - chill out"? It didn't seem that way to me.

      And now. without waiting for any clarification on my part, I have been given another -1. Does this thing have a monitor? This is just craziness.

      Thanks for all the responses guys, must admit, i'm a little scared here, didn't mean to wind any one up.
      I guess I should have been a lot clearer from the start. I apologise.
      This is what i'm doing.
      I'm running a microsoft query and I would like to save the file as a csv as I may need to load the contents into a database at some point.

      The code I posted was just a snippet of the program. The only area I am having problems with is the save command which refuses to save as a csv.
      I have looked at the microsoft documentation and tried diff. variations according to the documentation, all to no avail. Again my only issue is with the line that does the save.
      $excel->Application-> SaveAs ({ FileName:="c:/remedy2.csv",FileFormat:=xlCSV }) or warn("Couldnt save file: $!\n");

      Thanks again everyone


      Toni
        My experience is that MS products can't produce a useful CSV file even when you try to export manually from a document created in the product itself (Excel springs to mind).

        So, I'd skip the OLE\Excel steps and go straight for one of the pure Perl solutions mentioned. They are much easier, more controllable, and have a support community...

        Also, it might be helpful for us to see an example record of the type of data you're trying to CSV.

        I am sorry for scaring you. I did not intend to. You have a reasonable question, asked in a good way. What bothered me was the quality of the responses that you got. I hold answerers to a higher standard than questioners. As for your more specific question, there are two possible answers.

        One is to use the format_csv function that I gave you, and write a loop where you walk through your data, fetch it into Perl, and then write the file yourself. I would generally suggest doing that, my experience is that it is easier to pull data into Perl and manipulate it in Perl than it is to drive an external application.

        The other is to get the Excel approach working. Not having it available at the moment, I cannot test it. But I can tell you that the error message will not generally be put into $!. Instead you will need to call Win32::OLE::LastError() to get the error message. No promises, but the odds are pretty good that if you check that you will get useful feedback.

        Hey Toni, don't worry about it :-) It may be hard to tell, be we are all on your side.

        With that said, though - I haven't played with OLE in about a year, so I can't tell you anything off the top...

        Thanks for coming back to us :-D If no one has any solutions in the next several posts, I'll check it out when I get home and see if I can help.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://151925]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (None)
    As of 2024-04-19 00:00 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found