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
 Origin Forum
 Loading Files and Plot
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ESD Michi

Albania
Posts

Posted - 11/10/2006 :  07:50:47 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version 7.5G (Select Help-->About Origin):
Operating System:Win2000

We want to create a skript that offers a Window to choose a Datafile (csv).
This Datafile shall be loaded an the Data shall be plotted.
The relevant Data starts at row 109. (in this row the Names of the columns are saved)
From row 110 on, the measuring Data starts.
the Data for the x-axis is in the third column (after the 2nd comma), the Data for the y-axis is in the fourth column (after the third comma)

There should be the possibility to add further Datafiles which are also plotted in the same Diagram.

We are not sure how to realize this in Origin.
We would be very thankful for help.

Kind Regards, Juergen

zachary_origin

China
Posts

Posted - 11/11/2006 :  02:15:45 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
What you need is Import Wiard (do not know what is it in German). You can save it as a filter for further use. This link may do some helps.

Zachary
OriginLab Technical Services.
Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 11/12/2006 :  01:51:54 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You can also try an Origin C function like this which imports and plots all files selected in the dialog at the start. If you need to add curves from an existing worksheet use the Plot Setup or Layer Contents dialog.
void ImportTest()
{
StringArray sa;
int nFiles = GetMultiOpenBox(sa,"*.csv");
if( !nFiles ) return;

ASCIMP ascimp;
ascimp.iHeaderLines = 109;
ascimp.iDelimited = 1;
ascimp.iDelimiter = ASCIMP_DELIM_COMMA;
ascimp.iMode = ASCIMP_MODE_APPEND_COLS;
ascimp.iRenameWks = 0;
ascimp.iRenameCols = 0;
ascimp.iPartial = 1;
ascimp.iPartialC1 = 2;
ascimp.iPartialC2 = 3;
ascimp.iPartialR1 = 0;
ascimp.iPartialR2 = -1;

Worksheet wks;
wks.Create();
for(int i=0; i<nFiles; i++)
{
string sFileName = GetFileName(sa[i], true);
wks.ImportASCII(sa[i], ascimp);
wks.Columns(2*i).SetType(OKDATAOBJ_DESIGNATION_X);
wks.Columns(2*i).SetLabel(sFileName);
wks.Columns(2*i + 1).SetLabel(sFileName);
}
wks.ShowLabels();

GraphPage gp;
gp.Create();
GraphLayer gl = gp.Layers();
gl.AddPlot(wks,IDM_PLOT_LINE); // IDM_PLOT_SCATTER, IDM_PLOT_LINESYMB, ... (see OPlotIDs.h)
gl.Rescale();
}


Mike Buess
Origin WebRing Member

Edited by - Mike Buess on 11/12/2006 02:06:25 AM
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