09-17-2009 04:02 PM
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
Solved! Go to Solution.
09-17-2009 04:26 PM - edited 09-17-2009 04:26 PM
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.
09-17-2009 04:38 PM
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
09-17-2009 04:58 PM
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.
09-17-2009 05:12 PM - edited 09-17-2009 05:13 PM
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?
09-17-2009 05:30 PM
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.
09-17-2009 05:42 PM - edited 09-17-2009 05:47 PM
>.< 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...
09-17-2009 06:29 PM
Try something like this, perhaps?
09-17-2009 06:43 PM
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).
09-17-2009 08:09 PM