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
 How can I import a .txt file with text and number

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
yashe Posted - 05/22/2008 : 08:31:48 AM
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
2   L A T E S T    R E P L I E S    (Newest First)
yashe Posted - 05/29/2008 : 07:17:11 AM
Thank you very much. I have founded it.
Echo_Chu Posted - 05/29/2008 : 06:04:39 AM
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

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