Origin Ver. and Service Release: Origin Pro 8.0.63.988 SR6
Operating System: Windows XP Professionell 2002/ Windows 7 Enterprise
Hi.
I would like to write a C file to import a data file to do some further operations automatically.
For a data file with tabs as a delimiter, the following code works fine, but unfortunately, the relevant files have semicolons as delimiters. Therefore, the program doesn't import the data file.
What can I do make the program recognizing the semicolon as the delimiter?
By using the import wizard, I have already saved a filter, that can import the data file. Is it also possible, to implement this filter in the ASCII import in the code?
#include <stdio.h>
#include <Origin.h>
#include <wksheet.h>
#include <Array.h>
int TPD()
{
string file1 = GetOpenBox("*.csv");
Worksheet wks1;
wks1.Create();
wks1.GetPage().Rename("H2O_date",FALSE,TRUE);
ASCIMP ai;
if(AscImpReadFileStruct(file1, &ai)==0)
{ ai.iAutoSubHeaderLines = 0;
ai.iMode = ASCIMP_MODE_APPEND_COLS;
ai.iRenameCols = 0; column name
ai.iPartial = 1; import
ai.iPartialC1 = 0;
ai.iPartialC2 = 5;
ai.iPartialR1 =40;
ai.iPartialR2 = 50;
int nRet = wks1.ImportASCII(file1, ai);
out_int("nRet = ", nRet);
}
return 0;
}
I hope you can help me.
Cheers, Felix