I sympathise with you! I had to do this same conversion. I was trying to manipulate data using openpyxl but for some reason it wasn't doing what I wanted with with csv files so had to convert to xlsx first. For Windows? It can recurse sub-directories, delete original CSV files, combine all files to one document, and more. If you have Python installed, " csv2odf " is a open-source option and uses a templated approach to generate ods, odt, html, xlsx, or docx files. Sign up to join this community.
The best answers are voted up and rise to the top. Stack Overflow for Teams — Collaborate and share knowledge with a private group. Create a free Team What is Teams? Learn more. How to batch convert.
Asked 10 years, 6 months ago. Active 4 months ago. Viewed 87k times. Thank you so much. Please repost your question in a new thread and reference this thread if needed.
Do not post a question in the thread of another member -- start your own thread. If you feel an existing thread is particularly relevant to your need, provide a link to the other thread in your new thread. Old threads are often only monitored by the original participants. New threads not only open you up to all possible participants again, they typically get faster response, too. Originally Posted by LJMetzger.
Hi prosemur, Try the attached file. The attached Excel file has the capability of using. Comma , b. Semicolon ; c. Space d. Tab e. Vertical Bar aka Pipe Several test. Limitations: a. File 'Scratch. Embedded 'delimiter' characters are not allowed, except in 'Comma Delimited. File tested in US using 32 bit Office NOTE: I wanted to open the.
OpenText method requires extension to be. Non-working Code excerpt follows see the attached file for working code :. Originally Posted by suraba. Sorry I should say they are. Amended my original question. That's all good. Just change any reference to. The Code of Scott Holtzman nearly did it for me. I had to make two changes to get it to work: He forgot to add the line that makes our loop continue with the next file. ExcelFreak ExcelFreak 31 1 1 bronze badge. Bartolomeo Rodas Bartolomeo Rodas 1 1 1 bronze badge.
The Overflow Blog. Stack Gives Back Safety in numbers: crowdsourcing data on nefarious IP addresses. Featured on Meta. New post summary designs on greatest hits now, everywhere else eventually. Related Hot Network Questions. Question feed. If I'm not mistaken the code for. This line: ActiveWorkbook. I've changed the code so, described above; now the script works as expected: it generates xlsx files. Great Script after searching all other script available in google. Can anybody help how to modify this script by specifying a folder location in local drive instead of allowing it to open the dialog box as i am actually automating the system.
Thanks in advance. Hi, great script which worked for me after trying all other script available in google. I have added few more lines which performs the text to columns operation which i want. Can anybody help me how to modify the script by specifying the folder location in local drive instead of opening the dialog box as i am actually automating the system.
Hi Could you share the script that performs the text to columns?? Best Regards. Hello, a great article - thank you! Almost works for me. Here's the problem: I have a pipe-delimited csv file. So, when I open the csv file with Excel, it opens, directly reads and parses the fields to columns correctly.
All I have to do is to save as xls or xlsx, done. When I look at your code, that should be what the code does: It opens the csv files in a folder, saves them as xls or xlsx, and loops over that.
Here is the problem: When I open those Excel files, the pipe delimiters are still there, nothing is parsed to the columns. This was the behavior as before my change to the pipe delimited default setting in the Windows settings.
So it seems like Excel doesn't use those Windows settings. I verified this by replacing the pipe delimiters with comma delimiters in a copy of the file - of the two files, the pipe-delimited remained unparsed, the comma delimited got converted just fine.
0コメント