Loading 0
Share

My Blog

Scroll Down

Excel to csv as utf8 encode directly by Nicolas

Excel to csv as utf8 encode directly by Nicolas

Hi, I am Nicolas, you know me and I know you, we are humans with problems 😉

Unfortunately this year, I do not have much time to upload articles and videos because of my job as a web developer.

Many pieces of my work in the company I'm working on are automated on websites.
So wanting and not, I discover new things where I have decided from now on to share them with the world.

Because I will need a lot of time to upload all the articles, I will start with the last problem I faced.

A few days ago I encountered a problem.
I uploaded a csv file to e-shop bagdome.gr.
I use the file with the "wp all import" plugin on wordpress to import products.
The problem is that the file contained Greek characters and I had to open it with the notepad every time, and save it as utf8 encode.
The problem is that in the last few days I started to add the Bulgarian language in due to a new e-shop, which had to pull its data through bagdome.gr with xml.

I found out that by doing the export from excel to csv file, the Bulgarian characters were like this: ????????????

So I had to find a way to do the excel itself exporting csv to utf8.

As the old man say's, you must ask to find your way so, I searched on google and found nothing except some information from a source that led me to solve the problem by using an .exe, a vba code and a .bat file.

See the solution below:

  1. Create a folder in your C: Drive and name it CSV
  2. Open that folder and create a new file by right click and choose "new text file" and name it as "convert.bat" be carefull, the extension of the file must be .bat , not .txt
  3. Right click on the new file you just create and choose edit, and add the following code inside and save it: "%~dp0xls2csv.exe" "%~dp0temp.xls"
  4. Ok now download the following tool and extract it inside the folder: https://drive.google.com/open?id=0B0-xSvKcaUZhOHhldWdHd0F2Mkk
  5. Ok now its time to move the excel file you working on to C:CSV
  6. Open your excel file and search for the Developer tab, if you can't see it up there, go to File>Options>Customize Ribbon and check the Developer Tab and click OK.
  7. As soon as you are on developer tab, click on Visual Basic button.
  8. As soon as the visual basic window opens, right click on your left sidebar and choose Insert>Module
  9. As you can see the window of the new module opens so you can write your vba code inside
  10. Copy & Paste the following code: https://pastebin.com/v6sQudTC
  11. Read the comments with the green color and edit the code according to your needs.
  12. As soon as you finish with the code, close the visual basic window and save your excel file.
  13. Final go on Developer Tab, click the Macro button, choose your Macro and click Run

If everything is Ok an explorer window will open with your newly created csv file inside encoded as utf8.

 

This article is not finished 100%, I will record a video for this and also I will create a setup app with a demo excel inside so you can use it without the need of doing all this steps.

 

Best Regards, Nicolas Lagios

This post is also available in: Ελληνικά

Leave a Reply

Your email address will not be published. Required fields are marked *

01.

Here you can see all the services I provide

Registration and management of domain names (website address such as www.nicolaslagios.com)

Also management of dns records (e.g. connecting the domain to a specific server, fixing email spam problems, etc.)

Also ssl renewals etc

Installation and management of web & mail server in ubuntu vps with virtualmin, plesk, cpanel

Also studying and fixing server problems.

Necessary condition, the target server meets the conditions

At the moment for new wordpress websites you can choose from ready-made themes and we change the content (no custom changes). You can buy with a fixed price by clicking here!

My team and I undertake any data bridging implementation for Wordpress, Prestashop, Opencart, Joomla platforms.

We can connect data from any source, as long as the structure is stable and there is proper documentation and briefing.

We undertake the creation, regulation and enrichment of pages for social networks: Facebook, Linkedin, Instagram (profile), Twitter (profile), Tiktok (profile).

We also undertake the first boost of your pages for quick results in followers.

We undertake the repair and maintenance of your existing wordpress website.

For more information about the services, you can read the following and return here to schedule a meeting with me: https://maxservices.gr/en/internet-services/website-services-blank/additional-website-services/