05-02-2012 07:17 AM
Hi there, I've written a code in LabWindows/CVI in a way that it will create a big .txt or .DAT file at the end of the code, but as there some antenna pattern measurements and I've got 5 sets of 1601 points readings, so I just want to divide those 5 sets of readings in to 5 small .txt or .DAT file to look at the file individually and compare the values. So can you please help me in this that how can I do in the code that after creating .txt or .DAT file, it will after taking the reading, split the readings i.e., each 1601 point readings and save it in a file, for example, I've created test.DAT file and how can I do this that when creating and saving the data in the file, I'll split that test.DAT into small files like test1.DAT, test2.DAT, test3.DAT etc. I would really appreciate that if anyone could help me in this. Thanks very much for your time and concern. Hope to hear from anyone soon. Regards.
05-02-2012 08:21 AM
Most of the answer depends on how data are organized into the files.
Supposing text files are organized in rows (i.e. one line per measure, one set of measures after the other) you can simply do the following:
The result of this process will be a set of output files with the corresponding subsets of your big data set. This is not necessarily the fastest and most efficient method but is the quickest to code. Remember to add proper error tracking to I/O functions.
I suppose the .DAT file is some sort of compact (binary) file that you must treat according to the format of data in it: I cannot give you any hint on this as I don't know which data it contains.