If you are on a UNIX machine, you can put subsets of the fields from data files into separate Adaptive Server tables if you first invoke the cut utility to strip and save the desired columns from the file. Use the following command:
cut -f list -d , view_data_file > output_file_name
list is a comma-separated list of the field numbers that you want to cut and save from the original view data file. The first field has field number 1.
view_data_file is the name of the file where all of the recording data is stored.
output_file_name is the name of the file where the stripped data is to be stored.
After using cut, you can use the bcp utility to import the data in the output_file_name into an Adaptive Server table. Historical Server might return lines to the view_data_file that are similar to:
Suppose that you are interested in just the total I/O for each device during the sample. You could execute the following command to cut out the data you want by executing the following command:
cut -f1,2,5 -d, d1_1_device_io > d1_1_device.io.new
where field 1 is the date and time of the sample, 2 is the second field, which is the device name, and 5 is the fifth field, which is the device I/O value.
Now you can import the d1_1_device.new file into an Adaptive Server table as described in the previous section, “Bulk copy example”.
For more information about the cut utility, refer to the UNIX man pages on your system.