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
 Forum for Origin C
 How can I import a .txt file with text and number
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

yashe

Germany
Posts

Posted - 05/22/2008 :  08:31:48 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Version (Select Help-->About Origin): ORIGIN Pro 7.5G R3
Operating System: Windows 2000 SP4

I started to use origin c a couple of days ago. In these days I wrote a code that imports an ascii file and creates some columns in the worksheet. For example:

No. Adress Quality
1 120.34.5 good
2 345.434.4 bad

My problem is, how I can import a line. If I use "atof", the text "good" will be not shown.
StringArray is just for one-dimensional. What I want, ist two-dimensions. Has anyone a good idea? thanks a lot

Echo_Chu

China
Posts

Posted - 05/29/2008 :  06:04:39 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

You can use Worksheet::ImportASCII to import ascii file. for example,

void test_ascii_import()
{
ASCIMP ascimp;
string strFile = GetOpenBox("*.txt");
if(AscImpReadFileStruct(strFile,&ascimp)==0)
{
Worksheet wks;
wks.Create();
wks.ImportASCII(strFile, ascimp);
}
}



text can automatically be shown after imported
Go to Top of Page

yashe

Germany
Posts

Posted - 05/29/2008 :  07:17:11 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you very much. I have founded it.
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