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
 All Forums
 Origin Forum
 Origin Forum
 IMPORTING MULTIPLE ASCII

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
PF Posted - 01/16/2007 : 1:50:29 PM
Origin Version (Select Help-->About Origin): 7.5
Operating System: Windows 2000 Pro

Hello,

I'd like to import Multiple ASCII in a worksheet, do a bunch of operation and have them plotted. As I've never experienced OriginC programming, I'm quite lost with what I've seen on the forum.... so some tips would be of a great help...

Each ASCII file is composed by three columns. The first one is useless. The second one is composed of the x values. The third one is composed of the y values of a 2D graph.
The values of the second column of each files are the same (the x values don't change in a set of experiment). However, I need to do a calculation on the datas of the second column (Constant/col(2)), set it as X in the worksheet, and set the datas as ascending.
Once this is done, I need to plot the M third columns of the M files I'm treating on the same graph.

Another question is that I cannot find how to select by default 'import each files as' "New Columns" when using the 'Import Multiple Ascii' menu. Have you got a clue?

Thanks very much, Hope I was quite clear...

PF
4   L A T E S T    R E P L I E S    (Newest First)
a.abc.b35 Posted - 01/08/2011 : 10:17:02 PM
Thank you a lot

AB
PF Posted - 01/17/2007 : 05:31:33 AM
Thank you very much to both of you, everything's perfect now! I might be able to finish my work just in time!!!

Cheers, Bye
zachary_origin Posted - 01/17/2007 : 12:29:13 AM
Hi PF,

As for the second question, I think you are saying to make "New Columns" as default for the "Import Multiple ASCII" dialog everytime you open it, right?

If it is, you can open FILE.OGS under your Origin installation folder, find section [MultiImportWKS] and add line
FDLOG.multiopen.ComboSel=2;
after the line
FDLOG.MultiOpen.ComboList$=$File.WKSImportAsComboList;

Save the file and reopen the dialog, you can see the effect.


Zachary
OriginLab Technical Services.
Mike Buess Posted - 01/16/2007 : 10:24:47 PM
The function below imports the 2nd (X) and 3rd (Y) columns from the first file but only the Y column from the rest. Add it to your workspace as described here and execute from the script window... import_test dConstant where dConstant is the constant for the X column.
void import_test(double dConstant = 1.0)
{
StringArray sa;
int iCount = GetMultiOpenBox(sa, FDLOG_ASCII, NULL, NULL, NULL, false);
if( !iCount ) return;
Worksheet wks;
wks.Create(); // create wks
ASCIMP ascimp; // ASCII options
wks.GetASCIMP(ascimp);
ascimp.iPartial = ASCIMP_PARTIAL_YES;
ascimp.iPartialC2 = 2; // stop at col 2;
ascimp.iMode = 1; // import as New Wks(0), New Columns (1), New Rows (2)
char chPath[MAX_PATH];
for(int ii=0; ii<iCount; ii++)
{

ascimp.iPartialC1 = ii==0 ? 1 : 2; // start at col ii
wks.SetASCIMP(ascimp);
wks.ImportASCII(sa[ii], ascimp);
wks.Columns(ii + 1).SetLabel(GetFileName(sa[ii]));
}
wks.ShowLabels();
wks.Columns(0).SetType(OKDATAOBJ_DESIGNATION_X); // set 1st col as X
wks.Sort(SORT_DESCENDING);
Dataset ds(wks,0);
ds = dConstant / ds;
GraphPage gp;
gp.Create();
gp.Layers(0).AddPlot(wks); // plot all Y cols
gp.LT_execute("legend");
}
quote:
Another question is that I cannot find how to select by default 'import each files as' "New Columns" when using the 'Import Multiple Ascii' menu.
Use the drop-down list at the center of the dialog. Note that there will be no import option in the dialog created by import_test for which the option is set by ascimp.iMode.



Mike Buess
Origin WebRing Member

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000