LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

removing delimiters

A TCP read returns a number and a delimiter, cr/lf.  No matter what I tried, the only way I could get rid of the delimiter was to convert the string to a number and then back to a string.  Shouldn't there be a simplier way?


0 Kudos
Message 1 of 14
(3,759 Views)

Search and Replace under string functions.  search for end of line constant and replace with empty string constant

 



Message Edited by JeffOverton on 03-07-2008 12:06 PM
0 Kudos
Message 2 of 14
(3,758 Views)
The EOL constant will be platform dependent. A more precise solution is to wire in the explicit string you're looking for.




Message Edited by smercurio_fc on 03-07-2008 11:11 AM
0 Kudos
Message 3 of 14
(3,751 Views)
Didn't work.
Thanks anyway.
0 Kudos
Message 4 of 14
(3,747 Views)
What do you mean it didn't work? What exactly didn't work? What is the string that you're feeding in?
0 Kudos
Message 5 of 14
(3,741 Views)

If it still does not work, please create an indicator on your string, run the VI so the indicator contains typical data. Now change the indicator to a constant ("right-click...change to constant") and copy it to a new VI together with only the code you are using to remove the delimiters. Save it and attach it. 🙂



Message Edited by altenbach on 03-07-2008 09:22 AM
0 Kudos
Message 6 of 14
(3,740 Views)
I wasn't referring to your post when I said it didn't work but I think I tried your idea.
The TCP/IP Read returns a number string that when concatenated with another string shows that the first string is terminated by a cr/lf. All the methods I tried except converting the string to a number and back to the string did not result in a string that when concatenated did not have a cr/lf.

I made a simple vi where I added a cr/lf to a string and could remove it but it didn't work with the string from the TCP/IP.
0 Kudos
Message 7 of 14
(3,721 Views)
Then it may not be a CRLF. It may be CRCR or LLLL. Please follow altenbach's instructions, as it will be much easier to see what's going on. There is no reason for you to convert the string to a number and then back to a string again. This is a candidate for Rube Goldberg code, and I don't think you want to be another entry in that Hall of "Fame".
0 Kudos
Message 8 of 14
(3,715 Views)
I'm not sure I understand altenbach's instructions. There must be a way to parse the string that tells what the delimiters are.

RE: Hall of Fame. I take my entries into the Hall of Fame as badges of honor. If I can make something work, then I win; that's why they pay me the big bucks. 🙂
0 Kudos
Message 9 of 14
(3,711 Views)


exo wrote:
I'm not sure I understand altenbach's instructions.
have you tried? At which step did you get stuck?


exo wrote:
There must be a way to parse the string that tells what the delimiters are.

A string is just a string, delimiters could be anything you define as such. 😉
 
Try to display the string in a string indicator set to "\-codes" or hex display since you might be dealing with stuff that is not displayable in normal mode. 😉

0 Kudos
Message 10 of 14
(3,700 Views)