Gamma DISP: Reference Manual


ascii2float

ANSI-C program: ascii2float.c

NAME
ascii2float -  Convert text format data to float format

SYNOPSIS
ascii2float <data_in> <width> <data_out> [loff] [nl] [coff] [nv]

data_in (input) input text format data file with , or whitespace between columns
width
 number of data values (columns) in each line of text
data_out (output) ouput data file (float)
loff
offset lines to start of data (enter - for default: 0)
nl
number of lines (enter - for default: all)
coff
offset columns to begin reading data values (enter - for default: 0)
nv
number of values to read (enter - for default: to end of line)

EXAMPLE

ascii2float q.txt 16 q3

Converts the text file q.text with 16 columns of numbers to the binary file q3
Each line of q3 has 16 values that are 4-byte floating point numbers.

ascii2float q.txt 16 q3  2 14 2 8

Converts the text file q.text with 16 columns of numbers to the binary file q3.  The first 2 lines of the input text file are skipped and the subsequent 14 lines are read. Each line is processed by skipping the first 2 columns and then converting 8 values to 4-byte flot

DESCRIPTION

ascii2float is used to convert text format data such as a DEM into floating point binary data. The binary data are 4-byte floating point numbers. ascii2float has the loff and nl options to skip a specified number of lines of the text file and read only a specified number of lines. The input data are expected to be separated by either spaces,  commas, or TAB characters. 

The program can be instructed extract a specified number of values nv after skipping a specified number of columns coff on each line that is read in. By default all the values on a line are converted to binary format. 

SEE ALSO
float2ascii


© Copyrights for Documentation, and Reference Manual by Gamma Remote Sensing, 2012.
UW, CW, last change 7-Jun-2012.