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 for Programming
 Forum for Origin C
 Problem with Import

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
christo2 Posted - 08/06/2010 : 07:34:08 AM
Origin Ver. 8.0.63.988 Service Release SR6 (v8.0988)
Operating System: WinXp

Hi,

I came upon a problem with my importroutine, when i changed some phrasing in the file which I want to import (*.dat file). The phrasing is:

measurement resolution mode : NORMAL
measurement HIGH SENS mode : ON
DC SOURCE
DC Source AutoAdjust : OFF

I simply can't import it, when it is in this exact succession. I could change the succession, but I would like to know, what I did wrong. My standard import routine is:

string strfile, pfad;
StringArray saFilePaths;

StringArray saFileTypes;
saFileTypes.Add("[Messdaten (*.DAT)] *.dat");
saFileTypes.Add("[Messdaten (*.DTA)] *.dta");
saFileTypes.Add("[All Files (*.*)] *.*");

string strUserFilesFolder = "C:\measurement";

int nFileCount = GetMultiOpenBox(
saFilePaths,
saFileTypes,
strUserFilesFolder,
NULL,
"MultiOpen Dialog",
false);

if(saFilePaths[0].IsEmpty()) {return(false);}

for( int i = 0; i < nFileCount; i++ )
{
string strfile, pfad;
ASCIMP ascimp;

strfile = saFilePaths[i];
if(saFilePaths[i].IsEmpty()) { printf("Nothing has been chosen!"); return(false); }

if(AscImpReadFileStruct(saFilePaths[i],&ascimp)==0)
{
ascimp.iDelimited = 1;
ascimp.iDelimiter = ASCIMP_DELIM_SPACE;
ascimp.iMode = 1;
ascimp.nNumSep = NF_IS_AMERICAN;
ascimp.iAutoSubHeaderLines = 0;
ascimp.iSubHeaderLines = 0;
ascimp.iHeaderLines = 0;
ascimp.iTestLines = 75;
ascimp.iNumColumns = 75;

WorksheetPage impoPage;
Worksheet impo = impoPage.Layers(0);
impo.Create();
impo.ImportASCII(saFilePaths[i], ascimp);

string strBookName, strSheetName ;
string strBookSheetName = wks_get_book_sheet_name(impo);

if(get_book_sheet_names(strBookSheetName, strBookName, strSheetName)==TRUE) printf("imported File = %s\n", strSheetName);

impo.GetPage().Rename("Book"+i);
}
}

This routine usually does work. Just not with the lines I mentioned. If you could answer I'd be really happy!

Best regards,
conny
2   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 08/08/2010 : 10:36:46 PM
Hi conny,

With just the code you provided, we can not see what the problem is. If possible, could you please send us your data file via this page? Then we can have a try with the code to import your data file. Please refer to this post in your email.

Penn
christo2 Posted - 08/06/2010 : 07:43:02 AM
another thing I forgot to mention. That Problem (the file not being importable) also occures when I try to import it using the ImportWizard.

Best regards,
conny

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