Solved

Convert text file to excel in VB 6.0

Posted on 2009-04-05
6
1,708 Views
Last Modified: 2013-12-25
Hello.
I would like to convert .txt to .html, change encoding in .html (eg from default UTF-8 to cyrillic) and save the file into excel. Each entry should go into separate columns in excel as the .txt(now .html has delimiters).
Please can you help me with a solution in VB 6.0?

OR is there a direct way to convert characters either of the .txt or .xls file without the .html phase?

Thanks.



0
Comment
Question by:pplon
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
6 Comments
 
LVL 5

Expert Comment

by:Mechanic_Kharkov
ID: 24070829
You can directly copy / paste unicode data from notepad, for example. There is no need to use html.
Just try to open Your txt file with notepad, copy (with proper input language selected), and paste to Excel.
0
 

Author Comment

by:pplon
ID: 24070871
Sorry, I do not understand you.

The .txt file is the output from the database and this .txt has the encoding UTF-8.  How do I change the UFT-8 to say, cyrillic (dos) in .txt before I move data to excel? I want my VB code to do all these.

Thans very much.
0
 
LVL 5

Expert Comment

by:Mechanic_Kharkov
ID: 24070950
When you open txt file in notepad under Windows XP, it automatically detects Unicode format (e.g. UTF8). Copy, paste, and SaveAs would work with unicode data that you are free to paste anywhere, where unicode is supported. Even if unicode is not supported, clipboard will automatically convert unicode strings into ANSI with current locale in the clipboard.

Of course, if scripting of copy / paste is terrible thing, then there are a couple implementations of UTF8toANSI and back functions in The Net. ( e.g here ).
0
 
LVL 5

Accepted Solution

by:
Mechanic_Kharkov earned 500 total points
ID: 24070977
Excel itself convert txt files when opens them. Look the attached pictures.


Clip-20090405-133433.jpg
Clip-20090405-133510.jpg
Clip-20090405-133543.jpg
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question