Name | Modified | Size | Downloads / Week |
---|---|---|---|
Parent folder | |||
README | 2018-01-04 | 1.5 kB | |
test_a2b.f90 | 2018-01-04 | 2.6 kB | |
short.txt.unformatted | 2018-01-04 | 64 Bytes | |
short.txt | 2018-01-04 | 43 Bytes | |
a2b.f90 | 2018-01-04 | 6.9 kB | |
build | 2017-12-21 | 165 Bytes | |
Totals: 6 Items | 11.2 kB | 0 |
program a2b ! ASCII to Binary Convert an ASCII file (probably large) to its unformatted equivalent. The all-text case is much simpler, so it is prompted for. If reals, integers, and logicals have to be converted, each line has to be tokenized, and each token has to be tested for type. Writing each token as it is decoded avoids the problem of assembling an equivalent list of correct data types to be written as one record. Default types are assumed, so we don't attempt to distinguish 2-byte or 8-byte integers, etc. The output file name has the string '.unformatted' (or possibly '.u') appended to the input file name. Reading this file is bound to be application-specific. History: 12/20/2017 D.A.Saunders Initial implementation, with a FIAT material database (7,700+ lines) in mind. 12/22/2017 " " Pondered the hard case. Jeff Hill suggested writing tokens as we go, using advance='no', but that keyword is illegal for both unformatted and stream file writes. 12/28/2017 " " Tried stream file output with the pos=n keyword. 12/29/2017 " " Stream files work, but alphnumeric tokens need to be preceded by their length in the output. 01/03/2018 " " Hadn't meant to overlook logical variables. Author: David Saunders, AMA, Inc. at NASA Ames Research Center, CA.