취소
다음에 대한 결과 표시 
다음에 대한 검색 
다음을 의미합니까? 

scan tolken string

해결 완료!
솔루션으로 이동

OK I have been working with LabVIEW for many years and I have never understood the Scan strings for Tolkens.

 

Attached is what I expect, and what I am getting.  Please set me strait once and for all.

 

Dan

Dan Shangraw, P.E.


   

0 포인트
1/15 메시지
6,123 조회수

Would help if I posted a VI that illustrates my problem.

 

Late night and I am woozy from beating my head against the wall.

Dan Shangraw, P.E.


   

0 포인트
2/15 메시지
6,119 조회수

Your input string control is empty.  Try saving your VI again and posting it after putting some data in the input string and saving it as default.

 

Never mind, you reposted the VI.

Message Edited by Ravens Fan on 08-11-2009 11:11 PM
0 포인트
3/15 메시지
6,118 조회수

I've never used scan token string before.  Looking at the Context help and examples for it, it looks like it is meant to break up a string by the tokens, and is most useful if it is in a loop.  In your case, you are trying to find a string "wrapped" in your token.

 

I would use Search/Split string or Match Pattern to find the quotes and strip them out from there.

Message Edited by Ravens Fan on 08-11-2009 11:30 PM
0 포인트
4/15 메시지
6,111 조회수

I couldn't open the VI (still waiting for upgrade), but I did use the Scan String for Tokens in an example recently.  I have found it to be quite useful when I have a complex string to parse, with unknown or varying number of parameters.  I find that strings with regular patterns are more efficiently dealt with using string to spreadsheet array or scan string to number.

 

Reading Ravens Fan's post, I gather you are looking for values inside quotes, I have enclosed an example which pulls numbers out of a quoted, comma separated list.  The quotes are delimiters and tokens are the values you are looking for.  Hope this helps. 

0 포인트
5/15 메시지
6,095 조회수
Oops, posted old version, here is the corrected vi with initialized SR in while loop.
0 포인트
6/15 메시지
6,092 조회수

I'm getting something different...

 

scanstring.jpg

 

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

7/15 메시지
6,066 조회수
솔루션
주제 작성자 ASTDan이(가) 승인함

First of all, you're looking for the output from the wrong place.  "String out" is an unmodified copy of the input string.

 

"Token out" is the response you're looking for.

 

The first iteration will find your starting " as adelimiter and deliver the part of the string up to but not including the " character.  The second time you call the function (wiring through the returned index from the first run) it will give you the text between the first and second " which is exactly what you're looking for.

 

 Scan from token snippet.png

 

Shane.

 

PS My first Snippet! 😄

8/15 메시지
6,060 조회수

Just in case you expect more than 1 string between tokens 🙂

 

SNAG-019.jpg  

 

SNAG-020.jpg 

 

 

No one asked for it, yet, but who knows what tomorrow brings 매우 기쁨 이모티콘

9/15 메시지
6,051 조회수

Wow!  Thats how that works!  I was just inputing quotation marks.기쁨 이모티콘

 

I am going to haning out with Tom Bombadil now.

Dan Shangraw, P.E.


   

0 포인트
10/15 메시지
6,047 조회수