DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I control the order of files as written to the LST file of FileNameGet command with multiple files

The UseFileCommand is not loading my files in alphabetical order...nor in timestamp order...nor in the order I select them in the FileNameGet dialog box.

 

How do I control this?

 

It appears that the LST file created is where the problem lies.  The UseFileList variable, it appears, reads from the last entry, and works forward.

 

So I need a way to manage this..so that my data is processed according to the timestamp (earliest first) OR filename (alphanumeric sort, ascending)

 

Thanks

0 Kudos
Message 1 of 4
(3,993 Views)

Hmm, seems I did a better search this morning...and came across the following....

 

Previous sort request

 

Maybe an enhancement? 

 

In my case, the issue is I'm trying to process multtiple data files collected over 6 months of durability testing.  Out of the risk of losing data, our DAQ team has elected to open a new file every hour.  So, I end up with thousands of files.

 

I parse through these files, calculating time between various events.  Its CRITICAL that the calculations are in time-order.  The files each 1 Gb in size, so I prefer to utilize the filename (date/time sortable) or original timestamp.

 

If processed out of order, the durability data will likley imply something quite wierd (like improvement over time).  Of course, that would be great for a management review...but not so good when warranty starts coming back 🙂

 

I can write/copy any number of sort routines...I just thought the file order should be intuitive (either forward or reverse...not last, first, middle, etc...

 

Anyhow...I'd like to formally request an enhacement in the next ve.  rsion of Diadem; one that provides an additional parameter to be passed...SortField.  Useful options would include FileNameForward, FilenameReverse, TimeForward, TimeReverse, etc...

0 Kudos
Message 2 of 4
(3,982 Views)

Hi Jeff,

 

If you sort the selected files by file name, alphabetically, does that correctly sort them by DateTime?  If so, then that would be the easiest way to proceed, and I can immediately send you code to Bubble Sort an array of filenames.  If the datetime stamp is contained in the file name, but not such that sorting the file name does the trick, then we could instead alter the Bubble Sort to only pay attention to the datetime part of the file name.

 

If the DateTime information you want to sort from is not in the file name, then is it in a File or Group or Channel property, or are you needing to look at the first value of a particular Channel in each file?  If it is located in a property, then you could use the TdmHeaderObject to read out that DateTime property without loading the file into DIAdem-- this then could be built into the aforementioned Bubble Sort.

 

If you really need to look at the first value of the DateTime Channel in each file, then I'll need to know what type of data files these are-- ASCII or Binary, do you have a DataPlugin to read them, or are you importing them into DIAdem with some other method (which one?)?

 

Brad Turpin
DIAdem Product Support Engineer
National Instruments

0 Kudos
Message 3 of 4
(3,976 Views)

Brad, thanks for getting back to me...

  

I solved it with a bubble sort...plenty fast enough for my purposes.  We do timestamp our files names so that Alphabetical order IS time order (Glad I insisted on that).

 

Anyhow, all is well...the enhancement would be nice though  🙂

0 Kudos
Message 4 of 4
(3,972 Views)