Pathologically Eclectic Rubbish Lister | |
PerlMonks |
Re^4: Win32::OLE Excel search and replace commasby generator (Pilgrim) |
on Nov 08, 2010 at 04:41 UTC ( [id://870023]=note: print w/replies, xml ) | Need Help?? |
Thanks again for sticking with me on this. You are right about my taking the "long way" around to get my CSV file.
As I stated in my original post I was trying to replicate the steps I took manually to accomplsh the same thing. Until your post, I could not find how to replicate the search and replace finding commas and replacing with nothing After playing with your suggestions (and your code) I noted that your use of the "FileFormat" in... ...cleaned up any (text) fields with commas in them -- my biggest problem. Can you tell me where I might find the various options for "FileFormat" documented? The documentation installed with the module on my Windows Active State Perl installation isn't very comprehensive. The best piece of guidance I've found on this module was online at http://www.tek-tips.com/faqs.cfm?fid=6715. After finding your second response (almost a month after you posted it), I revisited this project and extended it a little to correct for situations where users enter a 1 or 2 digit code where my accounting program will expect to find a three digit code with leading zeros. By formatting the range containing the codes before saving the file as CSV I can correct for that. My current version (still a work in progress), here... ...checks the current directory for any excel files and pulls them into an array. Then each entry in that array is pushed through the routine you provided and the export file is like named with the CSV extant. Typical excel data would look like:
I've had no success finding a way to make the filepaths in the...
...sections dynamic. I tried "$files", "./$files" and "$fildir/$nwnam.csv" without success. Any ideas? It would be great if I could use the same code no matter where the user chooses to put the files as long at the compiled perl program is in the same directory with the excel workbooks. In my many google searches, many people suggest creating VB Macros in Excel then converting them to comparable statements in Win32::Ole. However I've not had any luck finding any beginner's tutorials or samples of how to do that. If you can suggest a source or process, I'd appreciate it. Thanks again. As a interested (but novice) Perl programmer, people like you and most of the other Monks who take the time to point the way are what keeps me from quitting in frustration.
<><generator
In Section
Seekers of Perl Wisdom
|
|