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
 Import Ascii File parts in different worksheets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

sp0094

Germany
Posts

Posted - 03/06/2008 :  08:04:14 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Echo_Chu

China
Posts

Posted - 03/08/2008 :  05:11:23 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

wufengseu

China
Posts

Posted - 03/09/2008 :  03:17:00 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The post http://www.originlab.com/forum/topic.asp?TOPIC_ID=6455
may help you!
Go to Top of Page

sp0094

Germany
Posts

Posted - 03/10/2008 :  4:05:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

wufengseu

China
Posts

Posted - 03/11/2008 :  01:59:34 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
// 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
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