LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Merging two or more unique strings

Hi,

Problem: I want to be able to merge two or more completely different strings into a single string. These strings can contains any letter or number; I don't want to merge the entire string all the time I want to be able to merge certain parts of it for example: String A contains: "Have A" String B contains: "Nice Day" String C contains: "#1" I want to be able to combine these strings in any form such as: "1 Have Nice A Day #".


I did a quite a bit of searching on Lab view I have found "Merge Query Expressions" but I don't think it will do what I am looking for I am still trying to get an output with it but I am unable to get at currently. I don't expect anyone to give me a flat out answer but if you could point me in the right direction I would be grateful. Any example I will happily accept thank you.




Message Edited by MrSafe on 08-11-2008 12:32 PM

Message Edited by MrSafe on 08-11-2008 12:32 PM
0 Kudos
Message 1 of 25
(6,850 Views)

What's the logic for the merging?
Is it done automatically?
Does the user decide? If so, what kind of interface would they use?

The functions in the string palette should be enough for pretty much anything you want to do, but you have to know exactly what you want first.


___________________
Try to take over the world!
0 Kudos
Message 2 of 25
(6,845 Views)
It will be done automatically.

All the user will do is select a couple of options such as locating a file that loads a set of data. The program will then take information from the file then combine that with another set of values to make a new file based on what it is reading. I can do everything so far EXCEPT merge strings to my liking. but the process will remain the same and consistent so it can be automated.


I am not sure string palette can do it I have lab view 8.2 standard edition perhaps i am simply very inexperienced with strings to realize this?
0 Kudos
Message 3 of 25
(6,841 Views)
If you know the format of your strings, you can use perhaps the "string subset" vi. You can specify an offset and a length and get a part of a string...in your example, you can split the string 3 into "1" and "#" and then merge them again with string 1 and string 2 using the concatenate string-vi.

Hope it helps

Christian

THINK G!! 😉
------------------------------------------------------------------------------------------------
Using LabView 2010 and 2011 on Mac and Win
Programming in Microsoft Visual C++ (Win), XCode (Mac)
0 Kudos
Message 4 of 25
(6,832 Views)

You still haven't explained the logic of what you want to do (meaning how the program will know how to combine the strings), but you can probably do everything you want with these functions:

  • Shift registers
  • Concatenate Strings
  • String Subset

Searching for them should provide more data.

If you want to learn more about LabVIEW, I suggest you try looking at some of these tutorials.


___________________
Try to take over the world!
0 Kudos
Message 5 of 25
(6,830 Views)
I will give it a shot thank you. If anyone else has more ideas please let me know no such thing as to much information =D
0 Kudos
Message 6 of 25
(6,827 Views)
I still don't see the rules for the merging defined. In your example you have:
String A: "Have A"
String B:
"Nice Day"
String C: "#1"
and a merged string of
"1 Have Nice A Day #". Any particular reason why the 1 is at the beginning? Can the merge look like "Have Nice A Day #1", or "Nice Day Have A #1" or "Nice Day #1 Have A", or "Nice Have # 1 A Day"?
0 Kudos
Message 7 of 25
(6,826 Views)
That is hard to explain for me but I will try my best:


The way it will work is:


1: Prompts User for a Template file

2: User Selects file

3: Program Grabs information from the file which is an excel file

4: Information from file is converted to strings which is done automatically no prompt is given to user it is done behind the scenes.
0 Kudos
Message 8 of 25
(6,822 Views)
A question that came up just a minute ago:


If lets say I have a path for a file C:test\foldername\sourcefile.xls


How do I get labview to read the path and send it back to me in a form of a string if the folder will change(meaning it will change in could be 3 characters could be 2 could be 20)?
0 Kudos
Message 9 of 25
(6,807 Views)
Well no there is no reason I was trying to give everyone an example of how flexible I need to make sure it is. The reason for this is because I plan on gathering information from a file which will be used as a file name for another.when combined it will not make sense all the time.

This file will contain client name standard tracker # etc
0 Kudos
Message 10 of 25
(6,799 Views)