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
 Import filter for CSV with qouted numbers
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

AKazak

Russia
1228 Posts

Posted - 07/06/2021 :  11:22:51 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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

Edited by - AKazak on 07/06/2021 11:23:05 AM

YimingChen

1685 Posts

Posted - 07/06/2021 :  12:26:28 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Check this tutorial:
https://www.originlab.com/doc/Tutorials/ImportWizard

James
Go to Top of Page

AKazak

Russia
1228 Posts

Posted - 07/06/2021 :  12:28:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

YimingChen

1685 Posts

Posted - 07/06/2021 :  12:35:28 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Have you tried Data Connector(menu Data->Connect to File->Text/CSV)? It automatically handles the quotes in the data.

James
Go to Top of Page

AKazak

Russia
1228 Posts

Posted - 07/06/2021 :  2:37:37 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

Chris D

428 Posts

Posted - 07/06/2021 :  2:51:20 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
wreplace type:=str find_str:=<[<">]> replace_str:="" lookin:=active_sheet;

Thanks,
Chris Drozdowski
Originlab Technical Support
Go to Top of Page

AKazak

Russia
1228 Posts

Posted - 07/06/2021 :  4:12:51 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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

Edited by - AKazak on 07/06/2021 4:13:03 PM
Go to Top of Page

Chris D

428 Posts

Posted - 07/06/2021 :  4:23:27 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page

AKazak

Russia
1228 Posts

Posted - 07/07/2021 :  04:08:59 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
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