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
 Skip adding "Linear interp of "
 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
1235 Posts

Posted - 05/19/2022 :  11:20:40 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2022b (64-bit) SR1 9.9.5.167
Windows 7 Pro SP1 x64

Greetings!

How do I tell interp1 to skip adding "Linear interp of " prefix to Comments?

Thank you.

---
Andrey

snowli

USA
1454 Posts

Posted - 05/19/2022 :  11:57:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Andrey,

I added ORG-25242 for both your cases of only show long name not SN + "long name" and this case.

Right now, we can only improve tool by tool and no gui control. Some user may prefer to have analysis info. in comments.

How about keep long name and units of source data in output long name and unit, etc.
Again we can only do tool by tool so if u have suggested tools, let me know.

Best, Snow
Go to Top of Page

AKazak

Russia
1235 Posts

Posted - 05/19/2022 :  1:00:42 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by snowli
How about keep long name and units of source data in output long name and unit, etc.
Again we can only do tool by tool so if u have suggested tools, let me know.

Best, Snow



I support this idea.
Keeping long name and units of source data in output long name and unit, etc. would work perfectly in my tasks.

What do you mean by "do tool by tool"?

---
Andrey
Go to Top of Page

snowli

USA
1454 Posts

Posted - 05/19/2022 :  1:37:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
I mean we have to implement it in each tool.

Thanks, Snow
Go to Top of Page

AKazak

Russia
1235 Posts

Posted - 05/19/2022 :  2:26:57 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by snowli

I mean we have to implement it in each tool.

Thanks, Snow



Dear Snow,

Got it.
Can you share an LT snippet to effectively find and replace the prefix, please?

---
Andrey
Go to Top of Page

YimingChen

1691 Posts

Posted - 05/19/2022 :  5:02:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Try this script:

for (int i = 1; i <= wks.ncols; i++) {
	string comment = wks.col$(i).comment$;
	comment.Replace("Linear interp of ", "");
	wks.col$(i).comment$ = comment$;
}


James
Go to Top of Page

AKazak

Russia
1235 Posts

Posted - 05/19/2022 :  10:06:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

Try this script:

for (int i = 1; i <= wks.ncols; i++) {
	string comment = wks.col$(i).comment$;
	comment.Replace("Linear interp of ", "");
	wks.col$(i).comment$ = comment$;
}


James



Dear James,

Thank you for sharing this.
Works correctly.

---
Andrey
Go to Top of Page

AKazak

Russia
1235 Posts

Posted - 05/20/2022 :  12:31:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
A side question about replacing double quotes.
The following options do not work:

Comment.Replace("\x22", "");
Comment.Replace("%(quote)", "");


How do I effectively replace/remove doubles in a text string?

---
Andrey
Go to Top of Page

YimingChen

1691 Posts

Posted - 05/20/2022 :  09:03:57 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Comment.Replace(char(34)$, "");
Go to Top of Page

AKazak

Russia
1235 Posts

Posted - 05/20/2022 :  10:42:25 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

Comment.Replace(char(34)$, "");




Got it.
Why don't \x22 and %(quote) work?

---
Andrey
Go to Top of Page

AKazak

Russia
1235 Posts

Posted - 05/30/2022 :  09:12:51 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by AKazak

quote:
Originally posted by YimingChen

Comment.Replace(char(34)$, "");




Got it.
Why don't \x22 and %(quote) work?

---
Andrey



Please share an update on the topic.

---
Andrey
Go to Top of Page

YimingChen

1691 Posts

Posted - 05/31/2022 :  2:15:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
1. You need to replace " to ' for this special case:
Comment.Replace('%(quote)', "");


2. \x22 is just a hex number which Labtalk doesn't recognize, you need to convert string representation of hex number to decimal then to string.
Comment.Replace(char(Hex2Dec("0x22"))$, "");


James
Go to Top of Page

AKazak

Russia
1235 Posts

Posted - 05/31/2022 :  2:25:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

1. You need to replace " to ' for this special case:
Comment.Replace('%(quote)', "");


2. \x22 is just a hex number which Labtalk doesn't recognize, you need to convert string representation of hex number to decimal then to string.
Comment.Replace(char(Hex2Dec("0x22"))$, "");


James



Dear James,

Got it.
Please add the examples above to the on-line help.

---
Andrey
Go to Top of Page

snowli

USA
1454 Posts

Posted - 11/11/2022 :  12:18:07 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Andrey,

In official 2023 build, u may find some improvements in this area such as analysis method and settings put to a new user-defined parameter row instead of put to comments, etc. and LN, unit carried.

Thanks, Snow

quote:
Originally posted by snowli

Hi Andrey,

I added ORG-25242 for both your cases of only show long name not SN + "long name" and this case.

Right now, we can only improve tool by tool and no gui control. Some user may prefer to have analysis info. in comments.

How about keep long name and units of source data in output long name and unit, etc.
Again we can only do tool by tool so if u have suggested tools, let me know.

Best, Snow

Go to Top of Page

AKazak

Russia
1235 Posts

Posted - 11/13/2022 :  05:22:28 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by snowli

Hi Andrey,

In official 2023 build, u may find some improvements in this area such as analysis method and settings put to a new user-defined parameter row instead of put to comments, etc. and LN, unit carried.

Thanks, Snow

quote:
Originally posted by snowli

Hi Andrey,

I added ORG-25242 for both your cases of only show long name not SN + "long name" and this case.

Right now, we can only improve tool by tool and no gui control. Some user may prefer to have analysis info. in comments.

How about keep long name and units of source data in output long name and unit, etc.
Again we can only do tool by tool so if u have suggested tools, let me know.

Best, Snow





Dear Snow,

Great news!
I will report here if find issues with 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