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
 LabTalk Forum
 import .dat files and del one column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

Skaytex

Lithuania
7 Posts

Posted - 02/12/2014 :  12:58:37 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8,6

My folder name is 77. It has (12) R*.dat files and one excel file

Im imported 12 R*.dat files in 12 workbooks with 3 cols
with this command
string path$ = system.path.program$ + "samples\\script\77";
findfiles ext:=R*.dat;
impASC;

and then imported excel file impExcel fname:="C:\77\a.xlsx";

Is it possible to import 12 R*.dat files to one workbook wich has named folder name (77) in 12 worksheets with first two cols and their names and than import excel file in 13 worksheet with his name.




KF

lkb0221

China
497 Posts

Posted - 02/12/2014 :  1:53:04 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

you can try to use some control options to specify the import, for example:

impASC options.ImpMode:=4 options.FileStruct.NumericSeparator:=0 options.Cols.NumCols:=2 options.Names.FNameToBk:=0 orng:=[B77];
impExcel fname:="C:\77\a.xlsx" firstmode:=sheet desig:=<Unchanged> options.names.FNameToBk:=0 orng:=[B77]13!;

The first one will import only 2 columns to multiple worksheets in workbook called "B77". Notice that we cannot use pure numeric to be book name.
The second one will import a excel file to the 13th sheet.

Since I don't have your files, so these two command might not be exactly what you need.

To learn more about import X-functions, please see the following pages:
http://www.originlab.com/doc/X-Function/ref/impASC
http://www.originlab.com/doc/X-Function/ref/impExcel

Zheng
OriginLab

Edited by - lkb0221 on 02/12/2014 1:53:29 PM
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