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
 Origin Forum
 Import filter for CSV with qouted numbers

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
AKazak Posted - 07/06/2021 : 11:22:51 AM
OriginPro 2021b (64-bit) SR2 9.8.5.212
Windows 10 21H1 x64

Greetings!

What is the best strategy to import the following text file (produced by Instron software):
Specimen properties : Specimen label,"2"
Specimen properties : Anvil height,"85.00000",mm
Specimen properties : Thickness,"1.00000",mm
Specimen properties : Width,"10.00000",mm
Specimen notes : Specimen note 1,"AAABBBCCC"
General : End date,"Monday, July 05, 2021 3:56:46 PM"
Test : Rate 1,"50.00000",mm/min

Time,Extension,Load
(s),(mm),(N)
"0.00000","0.00000","-0.00097"
"0.10000","0.00659","-0.01781"


Thank you.

---
Andrey
8   L A T E S T    R E P L I E S    (Newest First)
AKazak Posted - 07/07/2021 : 04:08:59 AM
quote:
Originally posted by Chris D

If you run:

wreplace -d;

It will open the dialog.

Fill out the dialog and in the theme flyout menu (arrow button), choose Generate Script to dump the code. You'll see that fancy bit that way.

~Chris

Thanks,
Chris Drozdowski
Originlab Technical Support




Got it!
Thank you for sharing this smart way of getting the required piece of code.

I would be great to have the Generate Script arrow button for Find and Replace dialog called from GUI, since currently it doesn't have this :)

---
Andrey
Chris D Posted - 07/06/2021 : 4:23:27 PM
If you run:

wreplace -d;

It will open the dialog.

Fill out the dialog and in the theme flyout menu (arrow button), choose Generate Script to dump the code. You'll see that fancy bit that way.

~Chris

Thanks,
Chris Drozdowski
Originlab Technical Support
AKazak Posted - 07/06/2021 : 4:12:51 PM
quote:
Originally posted by Chris D

wreplace type:=str find_str:=<[<">]> replace_str:="" lookin:=active_sheet;

Thanks,
Chris Drozdowski
Originlab Technical Support




Thank you for another discovery in the Origin world!
Where do I read more about <[<">]> syntax?

---
Andrey
Chris D Posted - 07/06/2021 : 2:51:20 PM
wreplace type:=str find_str:=<[<">]> replace_str:="" lookin:=active_sheet;

Thanks,
Chris Drozdowski
Originlab Technical Support
AKazak Posted - 07/06/2021 : 2:37:37 PM
quote:
Originally posted by YimingChen

Have you tried Data Connector(menu Data->Connect to File->Text/CSV)? It automatically handles the quotes in the data.

James



I don't want to use the CSV data connector in this case.
Can you check the correct usage of quotes in the LT snippet above, please?

---
Andrey
YimingChen Posted - 07/06/2021 : 12:35:28 PM
Have you tried Data Connector(menu Data->Connect to File->Text/CSV)? It automatically handles the quotes in the data.

James
AKazak Posted - 07/06/2021 : 12:28:16 PM
For now I leave the upper part of the file and import the header and data below as quoted texts.
Now I want to convert text to number by removing surrounding quotes for each cell:
wreplace type:=str find_str:="%(quote)" replace_str:="" lookin:=active_sheet;


However this command doesn't have an effect.
I consider that the issue is in specifying double quote character in find_str.
https://www.originlab.com/doc/LabTalk/ref/LT-Keywords suggests to use \" or %(quote), but none of these work.

What do I miss?

---
Andrey
YimingChen Posted - 07/06/2021 : 12:26:28 PM
Check this tutorial:
https://www.originlab.com/doc/Tutorials/ImportWizard

James

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