Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Splitting multiple day tables on a by day basis


rlwoell Jan 27, 2015 11:02 PM

I have data tables generated by a CR9000x that span many days. I want to split the large multi-day files into smaller files that contain data for only one day per file. The main files are often over 300Mb in size so using a text editor to cut them apart is tedious and time consuming. Automating the process would help a lot.

I know I can use Split to pull out data one day at a time. What I would like Split to do is copy the data from the first day to a file (maybe with the date as part of the filename) and when it reaches the second day, start a new file for that day, then move on to the third day etc., until it has reached the end of the file.

I can install other programs/editors if necessary. The advantage of using Split is that we all have it and others may desire this function as well.

Regards,

Robert


Dana Feb 3, 2015 07:05 PM

Hi Robert,

Take a look at Card Convert's "Destination File Options". Choose the "Use Time" check box and then enter an interval into the Time Settings dialog. If I understand correctly, this will do what you want.

I was thinking you might be able to do what you want using Split's Trigger On Stop condition, but after re-reading the info on it, it will write time series data to the same file, based on a stop condition, but won't create multiple files (I don't think...I didn't test it).

Dana


rlwoell Feb 3, 2015 08:03 PM

Unfortunately my files are in ASCII format, not binary. Convert doesn't recognize them.

I too thought that Split would work but came to the same conclusion after reading the help files and examples. I did spend some time trying a few things and it worked on one day at a time only.

I may go in search of a good programmable editor.


Dana Feb 3, 2015 09:50 PM

Have I got a tool for you ;)

Look in the C:\Program Files (x86)\Campbellsci\FileFormatConvert directory for FileFormatConvert.exe (or, if you are running Windows 7 you can get to it from the Start menu). This will do the same thing, but will work with any file type and convert to any file type. Sorry I made the assumption you were using TOB1 files.

FileFormatConvert is a relatively new tool which doesn't get much press (or have a lot of documentation).

Dana


rlwoell Feb 4, 2015 10:12 PM

Dana,

I owe you one. I just tried this on a relatively small file with about 10 days worth of well behaved data. It worked great and I had to only look up only one thing in the help file.

Next I will try a large file (350Mb) that has some discontinuities and some repeats. I will let you know how this works out.

Thanks,

Robert


Dana Feb 4, 2015 11:18 PM

Thank you for letting me know.

I ran it on a file that had four years of hourly data, and it worked fine. I'm sure I must have had some discontinuity in there, somewhere, but I didn't specifically check for that.

If you run into issues, contact me via email and I'll look into it.

Dana


rlwoell Feb 5, 2015 10:34 PM

It seemed to work fine on a 350Mb file made up of 5 days worth of data. Total size of the 5 parts were slightly larger (3K total on five files) than the single file but I expect that is due to each file having a header section.

This will save me many hours of work.

Thanks again.

Log in or register to post/reply in the forum.