First, obtain makeCDF software from CDAWeb:
http://spdf.gsfc.nasa.gov/makecdf.html

Caveat:
The ACE Science Center uses a fairly ancient version of the makeCDF software. 
Instructions and example files below are good for CDF version 2.5.
YMMV for later versions, but these instructions should still be
generally correct

Now, let's assume you want to create a CDF file for a
given data-set, for a given day. Here, we'll use ACE MAG
1-hour data for April 10, 2011 as an example.

Apart from the data itself, the makeCDF software requires
two other input files: a "skeleton" file and a "translation" file.

The skeleton file is a kind of CDF file with no data in it, but
it contains all the required metadata.
Most of the content of the skeleton file is static, but a few
parameters change for each CDF file, e.g. dates, times, version numbers, etc.
So, you need to create a separate skeleton file for each CDF file that you 
create.

At the ACE Science Center, we have a "template" skeleton file for
each data set that we regularly convert to CDF. We have a script that
creates a unique skeleton file from the template, for each day of data
that we convert to CDF.

The translation file describes the format/structure of the
input ASCII file. This file is "static"; you use the same
translation every time for all CDF files for a given data set. 

So, to convert our April 10, 2011 1-hour MAG data to CDF, we
follow these steps:

1) Prepare an ascii datafile containing the data, in the
format described in the translation file

2) Prepare a skeleton file from the skeletion template file

At this point, the fillowing files should exist:
mfi1h_20110410.dat		The input ASCII file, in the format specified by the translation file
mfi1hr_CDF.skt.template		The skeletion template file, from which mfi1h_20110410.skt is created
mfi1h_20110410.skt		The skeleton file specific to 2011-04-10, for this data set
mfi1hr_CDF.tran			The translation file

3) Run the following command:
makecdf mfi1h_20110410.dat mfi1hr_CDF.tran mfi1h_20110410.skt ac_h2_mfi_20110410_v05.cdf

THe command should produce the following CDF file:
ac_h2_mfi_20110410_v05.cdf

