Convert Fixed Format Data to Fields

DESCRIPTION:
Converts fixed format data into fields, separated by a specified character string, by default a tab.

USAGE:
make.fields(columns, infile, outfile, separator="\t",
    blanks.out=T)

REQUIRED ARGUMENTS:
columns:
a numeric vector whose elements are the starting columns (in order) of the fields in the input file.
infile:
string giving the name of the input file.

OPTIONAL ARGUMENTS:
outfile:
string giving the name of the output file. Defaults to ".new" pasted on to the name of the input file.
separator:
string giving the desired separator between fields in the output file.
blanks.out:
flag to cause trailing blanks in the output fields to be eliminated.

SIDE EFFECTS:
The output file will be written with the same data as the input file, but with the separator string inserted to separate fields. This file is then ready for input via scan, at least in the sense that it has a known field separator.

SEE ALSO:
scan .

EXAMPLES:
make.fields(seq(1,80,8), "myinfile", "myoutfile", sep=":")
scan("myoutfile",sep=":")