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
 Origin Forum
 Importing file with variable number of header line
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ecanod

Spain
1 Posts

Posted - 08/22/2023 :  04:09:00 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 2022b (64-bit). 9.9.5.167 (Academic)
Operating System: Windows 10 64 bit

I am trying to create a filter to import some ASCII files using the Import Wizard. I want to create a custom filter, since this is a routine procedure I need to do over an over again. The file consists in a variable number of header lines, 2 subheader lines (containing the name and units of columns), and the data in columns separated by tabs. This is an example of the file structure:


EXPLAIN
TAG POTENTIOSTATIC
TITLE LABEL Potentiostatic Scan Test Identifier
DATE LABEL 19/6/2023 Date
TIME LABEL 9:25:29 Time
NOTES NOTES 7 Notes...
Bla, bla, bla
Na2SO4 0.5 M pH~7
Some notes of the experiment (The number of note lines is variable)
PSTAT PSTAT Potentiostat
[...several other similar lines here]
CURVE TABLE 6530
Pt T Vf Im Vu Sig Ach IERange Over Temp
# s V vs. Ref. A V V V # bits deg C
0 5 -8,98284E-001 -3,75390E-001 0,00000E+000 -9,00000E-001 8,42111E-004 11 ........... -327,66
1 10 -8,98954E-001 -4,32104E-001 0,00000E+000 -9,00000E-001 7,64354E-004 11 ........... -327,66
2 15 -8,98949E-001 -4,44809E-001 0,00000E+000 -9,00000E-001 8,42484E-004 11 ........... -327,66
3 20 -8,98950E-001 -4,44643E-001 0,00000E+000 -9,00000E-001 7,57347E-004 11 ........... -327,66
[...]


The problem is that the "automatic header detection" fails to identify the header lines. Each header line start with a different character, so the option of identifying headers "By leading character" is not valid; but the last one starts always with "CURVE", so it should be easily identified.

In summary, what I need Origin to do is:
- Find the line starting with "CURVE"
- Set this and all previous lines as "Header"
- Set the next line as "Long name"
- Set the next line as "Unit"
- Import the data in columns separated by TAB

Any way to do it without programming a script (which is something I am unfortunatelly unable to do)? The idea of finding the end of headers looking for specific character(s) seems quite useful and simple to implement if not available yet.

Thanks,


YimingChen

1592 Posts

Posted - 08/22/2023 :  08:44:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You could use data connector (menu Data:Connect to File:Text/CSV). Then choose the file and use the settings below:



To connect to multiple files, you could choose menu Data:Connect Multiple Files...

James
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