The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 custom import
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Weldon

USA
Posts

Posted - 02/20/2005 :  11:09:57 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): 7.5
Operating System: w2k

I have a lot of data to incorperate into worksheets. Each set of data is in a folder that also provides the worksheet name. Each folder has approximately 100 different text files. They're poorly named, but the column names I want are in each file name, (they're also in the header), in fact they're the last 6 characters.

The first column in each file is the same data repeated, I only want to import it once and then for every other file, I want only the second column.
I did a file by hand using the import wizard as a starting point, It took over an hour to clean it all up. I have dozens of such folders and probably many more to come. A customised import function is definitely the way to go. I'm hoping I can find some code that I can modify for my purposes as a jumping off point. I've done some C++ programming before si I should be able to work out the mecessary modifications.
Thanks,
Weldon

Mike Buess

USA
3037 Posts

Posted - 02/20/2005 :  11:57:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The Origin C code I suggested in your LabTalk forum topic is as good a starting point as any. You should only need to replace the column naming statement wFin.Columns(j).SetName(sCol) with wFin.Columns(j).SetName(sCol.Right(6)).

...Worksheet::ImportASCII does pretty well at importing ASCII data. See the Get/Set ASCII Import Structure example here for hints about tweaking the ASCII settings.

Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 02/20/2005 12:11:41 PM
Go to Top of Page

Weldon

USA
Posts

Posted - 02/20/2005 :  10:30:33 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
A good start, thanks.
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000