02-21-2006 10:14 AM
02-21-2006 10:26 AM
02-21-2006 10:33 AM - edited 02-21-2006 10:33 AM
Message Edited by altenbach on 02-21-2006 08:40 AM
02-21-2006 10:51 AM
Lynn:
Well, my source is a CSV file that's how I know there is no data. This is just a part of my VI and I have to read the array after reorganization by some kind of indicators and that's why I choose zero instead of N/A. Thank you for your reply.
Altenbach:
Thanks for your VI. I am looking into it right now.
Dave
02-21-2006 03:54 PM
Hey, would you interest in a second round 2D array recoganization ?
101,79.0,2005-11-01 03:15:00
101,79.0,2005-11-01 03:30:00
...
...
...
108,71.0,2005-12-16 11:00:00
108,71.0,2005-12-16 11:15:00
201,83.0,2005-11-01 01:30:00
201,83.0,2005-11-01 04:00:00
...
...
...
903,82.0,2005-12-16 12:00:00
903,81.0,2005-12-16 12:15:00
This is a fractional of the CSV file I was talking about. And my question is "how can I convert the data&time into something I can use?" The data was record in every 15mins if there is good communication. It's not as easy as 1,2,3 in the previously message. If I read this CSV file using "Read From Spreadsheet File", the third column will show 2005 only since " - " isn't a number. If I use "Read Characters From File" or "Read Lines From File", that will end up into a big string. I am thinking to use "Search and Replace String" so I can make the third part as 200512161100 then storm my brain again. I also think of to convert the data and time into seconds but I don't know how to do that.
Can anyone give me any idea ?
Also, in the previous message, I had 101,102 and 103 in the first column. But actually I have 101, 102....108, 201....808,901,902 and 903 in my first column, which is not a continuous set. I am thinking to use a loop to make that set become 0,1,2...67 for further programming use. A while loop will decide how much has to be deducted. For example, 101~108 will be deduct 101 to become 0~7 and 201~209 will be decudt 193 to become 8~16. Is this the only way I can do?
02-21-2006 04:08 PM
02-21-2006 05:24 PM - edited 02-21-2006 05:24 PM
Message Edited by jasonhill on 02-21-2006 05:25 PM
02-22-2006 01:48 AM
@jasonhill wrote:
LV8 makes it a little easier with the Scan from String function.
Why 8? This already exists in several older versions.
I wrote the attached VI once for doing these conversions (personally, I believe a VI with this functionality should be an LV primitive). It's not as efficient as the direct conversions, but it does help if you have varying formats. P.S. - I haven't thoroughly tested this VI. It may still have bugs.
02-22-2006 08:15 AM
02-22-2006 11:15 AM
Yes, the Scan From String really works !! I use Read Lines From File and then Scan From String to get time stamp just as Jasonhill showed. With the remaining string and the Feedback Node , I can read through all the lines and put those into a array.
Thank you all !!!!!