swapascii
Overview
swapascii reads a 3-column ASCII lat lon depth file (up to 10,000 records) into memory and writes the records out in reverse chronological/spatial order (count - 1 down to 0).
Usage
swapascii (-verbose) infilename outfilename
CLI Options
| Flag | Arguments | Default | Description |
|---|---|---|---|
<infilename> | <path> | required | First positional argument: input 3-column ASCII lat lon depth file (double lat, double lon, int depth). |
<outfilename> | <path> | required | Second positional argument: output reversed ASCII lat lon depth file. |
-verbose | none | 0 | Enable verbose flag. |
How It Works
- In-Memory Ingestion: Reads
lat[count],lon[count], and integerdepth[count]triples from<infilename>until EOF (up to 10,000 rows) and printscount : <N>. - Reverse Output: Loops
ifrom0tocount - 1, writinglat[count - i - 1],lon[count - i - 1], anddepth[count - i - 1]to<outfilename>.
Practical Examples
Reverse the order of an ASCII bathymetry profile
swapascii profile_north_to_south.xyz profile_south_to_north.xyz