How to import Text file to Excel

S

Sobhan

Hi all,
Iam new to excel programming. What iam trying to do is to read
a .txt file in CSV format from a specific directory and import that to
excel after grep(Unix System() command) for certain keyword in the
..txt file.
Do anyone has done similar thing can give a clue?

Regards
Bubunia
 
D

Dave Peterson

If you've already gotten your .txt file, then record a macro when you import it
manually the first time.
 
S

Sobhan

Dave Iam not clear what you are trying to explain. Would you mind
elaborating a little??
Iam using VC++.
 
T

Tom Ogilvy

Dave is saying you can see the vba code to import a csv file by recording a
macro while you do it manually (in Excel).

If you are using C++, this still might be useful in seeing what command to
use and the syntax/arguments for that command.

Other than that, you might want to build a safearray of your data and write
that to your worksheet. You might search the knowledge base on VC++,
Safearray and Excel.

http://support.microsoft.com
choose advanced search, product Excel for windows.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top