LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

string to array OR array to string

Solved!
Go to solution

Hey all,

I'm stuck and the posts I've searched don't seem to answer my question...

 

I've got several 1D arrays that I'm running into a build array function and trying to put several arrays of strings before that data in a file, but I'm unable to get the strings into an array so I can put them into the build array (what I normally do) or get the 1D arrays into a string and format them appropriately (not familiar with) so that each array of strings fill a column, like this:

 

 

1 1 Injured Left Unstretched Left Injured Data1 Data2  etc...

1 2 Injured Left Unstretched Left Injured Data1 Data2  etc...

1 3 Injured Left Unstretched Left Injured Data1 Data2  etc... 

 

I believe I have the functionality down, just getting what I have into a document is where I need some help! I've attached a .jpg of a portion of the code to give context.

 

Thanks!

Tyler 

Tyler C. | Certified LabVIEW Associate Developer

0 Kudos
Message 1 of 11
(4,412 Views)

First some coding advice: never operate on paths as strings. Use built path for the parts in the upper left.

 

Your code makes little sense. Can you attach a real VI and some data?

 

Your FOR loop is definitely not needed, the shift regsiters should be in an outer while loop.

Message Edited by altenbach on 09-17-2009 02:26 PM
0 Kudos
Message 2 of 11
(4,395 Views)

Altenbach,

Here's the VI and some data. I used the FOR loop because I want 20 (and only 20) of the items written into the first 6 columns of the document...I suppose a WHILE loop with a boolean equal to 20 iterations would suffice as well.

 

Thanks,

Tyler

Tyler C. | Certified LabVIEW Associate Developer

Download All
0 Kudos
Message 3 of 11
(4,383 Views)

Build paths, changed! Probably worth stating that I'm aware the files are text, I just use excel to look at them so I include the .xls when the files are written. Smiley Happy 

Tyler C. | Certified LabVIEW Associate Developer

0 Kudos
Message 4 of 11
(4,365 Views)

Can you tell me how the arrays are supposed to mesh with the strings in the final array?

 

You are also converting random strings to DBL. Can you tell me the final output you want from the existing dataset?

Message Edited by altenbach on 09-17-2009 03:13 PM
0 Kudos
Message 5 of 11
(4,355 Views)

I want the final data set to look like this:

 

1 1 Injured Left Unstretched Left Injured Angular Velocity Average Torque Centroids INT DF Slope PF Slope 

etc...

I'm not sure if that answers your question though... 

 

All I'm trying to do is pull the data within each of these files into one file that I can append to, that way I can compile the data I have in a format that can be dumped into SAS.

Tyler C. | Certified LabVIEW Associate Developer

0 Kudos
Message 6 of 11
(4,348 Views)

>.<   I'm not able to edit my post...I've somehow gone over the 10k character limit. In any case, maybe this excel will help explain how I'm trying to get the data to look. This would be the result of running the program 4 times...

 


Message Edited by Ty13r on 09-17-2009 05:47 PM
Tyler C. | Certified LabVIEW Associate Developer

0 Kudos
Message 7 of 11
(4,342 Views)
Solution
Accepted by topic author Tyler_C

Try something like this, perhaps?

Message 8 of 11
(4,316 Views)

Yes, nearly...I've much to learn lol.

 

1. I realized I made a mistake in the set up of the "Prompt User for Input" in that I don't always have an injury...so in cases where I don't have an injury, I'd set it up to output "Right Injured".  I'm not familiar with how you programmed this, how would I add another case for the Right Injured/Left Injured so that I could have an Uninjured case? Should I set up a case structure off of the "Injury" boolean?

 

2. I dropped a Write to File in, changed it to string, but can't hook the wires up because the source is a string.

 

Like I said, I've a lot to learn, the majority of the programming I've done on this project is arrays and paths (strings here).

 

 

Tyler C. | Certified LabVIEW Associate Developer

0 Kudos
Message 9 of 11
(4,309 Views)
Ok, both of those problems I was able to solve (kinda), but I made another. This probably looks akin to a caveman attempting heart surgery with a stick and flint, but here's what I did (see attached VI). The issue I have now is that the string prints fine, but going to an array, no luck.  I'm pretty sure that it has something to do with concatenating then building back the string.
Tyler C. | Certified LabVIEW Associate Developer

0 Kudos
Message 10 of 11
(4,288 Views)