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
 Import Ascii File parts in different worksheets

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
sp0094 Posted - 03/06/2008 : 08:04:14 AM
Origin Version (Select Help-->About Origin): 7.5
Operating System: Windows

Hi,
i have a problem. I have an Ascii file, which contains data from mutliple scans. Every new scan is appended to the file and seperated with a new header. I want to copy each header into a separate Notebook and the following data into a separate worksheet. I have no idea how to split the different scans from each other.
Is this possible or have i to split the file in before?

Thank you
Christian

Origin ver. 7.5
4   L A T E S T    R E P L I E S    (Newest First)
wufengseu Posted - 03/11/2008 : 01:59:34 AM
// Original file format
set your worksheet name: Origin2008, and activate it
column1 Origin2008_part_1
....... ............ ....... ....... //data area
....... ............ ....... ....... //data area
column1 Origin2008_part_2
....... ............ ....... ....... //data area
....... ............ ....... ....... //data area
column1 Origin2008_part_3
....... ............ ....... ....... //data area
....... ............ ....... ....... //data area

and so on

// desired file format is as followed after doing split_wks():
*************worksheet name: Origin2008_part_1**************
column1 Origin2008_part_1
....... ............ ....... ....... //data area
....... ............ ....... ....... //data area

*************worksheet name: Origin2008_part_2**************
column1 Origin2008_part_2
....... ............ ....... ....... //data area
....... ............ ....... ....... //data area
*************worksheet name: Origin2008_part_3**************
column1 Origin2008_part_3
....... ............ ....... ....... //data area
....... ............ ....... ....... //data area
and so on

If you want to copy each header into a separate Notebook and the following data into a separate worksheet.On condition that the seperated strings in different character lines contain a same string(even part of it is the same by using TrimRight() and TrimLeft()) in a column, we can
reach the goal only with a small change of split_wks(). Else, it does not work.

If there are any more questions, you can send a data file to
my Email: wufengseu@yahoo.com.cn , I would deal it in time if not occupied.



Edited by - wufengseu on 03/11/2008 02:25:36 AM
sp0094 Posted - 03/10/2008 : 4:05:10 PM
Thank you for your answers.
I have tried to import the data via the Import wizard, but this doesn`t work properly.
So I want to find a OriginC solution for this problem.
The advantage of a OriginC solution would be, that it would be possible to set the Worksheet labels to something from the hader and copy the hader in a separate note. I have started to write a macro for this but I am still far away from a working solution.
I had also a look into the post, but this doesn`t work as I want and I do not understand all the program stuff in there.
Is it possible to upload here an example file? Maybe it would be easier to understand what I am searching for.

Thank you again for your answers.

Christian


Origin ver. 7.5
wufengseu Posted - 03/09/2008 : 03:17:00 AM
The post http://www.originlab.com/forum/topic.asp?TOPIC_ID=6455
may help you!
Echo_Chu Posted - 03/08/2008 : 05:11:23 AM
Hi, Christian

Your problem can simplily solved with import wizard.
1. Import your file in import wizard,
2. Go the 4th page, Data Selection Page
3. In the upper-right corner of page, there is "Non-numeric data in a numeric field combo" box, please Start new worksheet in the combo
Then each part of your data will be imported in a new sheet.


Or are you seeking for a OC solution?

Echo
OriginLab Corp

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