LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Reading from text file and displaying after formatting-Suggestions on program design

Hi All,
 
I have a file with .DAT extension.
 
 
Sample data from the file is as follows.
 
       22130     1070404       00000
       22130     1070404       00011
       22120     1070404       00600
       22100     1070404       02100
       22090     1070404       03600
 
 
The first value is the level which i have to divide by 1000,the second field is the yearmonthdate which i have to format(after omitting the first digit which is always 1) as dd/mm/yyyy.1070404should be displayed as 04/04/2007 and the 3rd one is the time which i have to format as hh:mm:ss   am/pm.ie,000000 should be displayed as 12:00:00 am.
 
There may be around 200 entries in the text file.For each entry(ie,record in the database notation) i have to perform the formatting  operation.And finally the 200 entries should be displayed in a table /multi column list box.
 
I did the same operations with some other additional operations like delete duplicates,by reading from access table.But that is very slow.
 
Now i have to read from the text file and finally display it after formatting.
Will it be slow as there are around 200 entries in the text file and for each entry i have to perform the operations for formatting.
 
Iam attaching one file with .txt extension which contain data.
 
Please give me some suggestions on how to desighn the program
 
Thanks in advance
 
 
    
 
 
 
 
 
 
 


Message Edited by user_1 on 12-31-2007 12:53 AM

Message Edited by user_1 on 12-31-2007 12:54 AM
0 Kudos
Message 1 of 7
(2,813 Views)
Doing this is not difficult or slow. Since you're only dealing with about 200 entries it's best to just read the whole file in and then work with arrays. The key is in determining whether you need to use timestamp datatypes, or you need to convert your date/time value to just properly formatted strings. Do you know which one you need? Attached is a VI (LabVIEW 8.2) to get you started.
Message 2 of 7
(2,787 Views)
One of the proven veterans could probably do a better job here commenting on performance and using access databases.  I tend to use format strings when special formatting is required, and Labview 8.5 has some better format options.  You will have to convert from Labview 6i to 8.5 or whatever version you are using.  SS
 


Message 3 of 7
(2,779 Views)
Sorry I did this last night and didn't notice the post was updated:)


0 Kudos
Message 4 of 7
(2,777 Views)
Hi Shot Simon,
 
Thank u so much for the reply with the helpful sample vi.
 
Thanks once again
0 Kudos
Message 5 of 7
(2,744 Views)
Hi Smercurio_fc,
 
Thank u so much for the reply.
 
I forgot to mention my labview version.I am using labview 8.0
 
So couldnt open the VI sent by u.If u dont mind,can u please send it again in earlier version?
 
Thanks once again
0 Kudos
Message 6 of 7
(2,743 Views)
Attached is the starter VI I created, resaved as 8.0.
Message 7 of 7
(2,733 Views)