Differences between revisions 5 and 6
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
SED is a UNIX text tool.  From this [http://unxutils.sourceforge.net/ GNU Utilities site], download Unxutils.zip and unzip sed.exe from it. SED is a UNIX text tool. From this [http://unxutils.sourceforge.net/ GNU Utilities site], download Unxutils.zip and unzip sed.exe from it.
Line 17: Line 17:
/^\./d
/^$/d
/^ DESIGNATION/s/^ /*/
/^ PID/s/^ /*/
/^ STATE/s/^ /*/
/^ USGS/s/^ /*/
/^ /s/^ /* /
/MONUMENTED/s/HISTORY/XISTORY/
/^ HISTORY/d
/XISTORY/s//HISTORY/
/^ HISTORY - /s//* MONUMENTATION: /
/ MONUMENTED /s//by/
/^ /d
Line 22: Line 31:
/^\./d
/STABILITY:/d
/SATELLITE:/d
/SUPERSEDED SURVEY CONTROL/d
/NATIONAL GRID SPATIAL ADDRESS/d
Line 23: Line 37:
/SP_SET/s//SPECIAL SETTING/
/^$/d
Line 24: Line 40:
/^ _MARKER/s/_/ /
/^ _SETTING/s/_/ /
/^ _STAMPING/s/_/ /
/^ GEOID/d
/^ DYNAMIC/d
/^ MODELED/d
/^ VERT ORDER/d
/^ NGVD 29/d
/^ _/d
/^STABILITY/d
/^SATELLITE/d
/CURRENT SURVEY CONTROL/d
/SUPERSEDED SURVEY CONTROL/d
/MONUMENTED/s/HISTORY/XISTORY/
/^ HISTORY/d
/XISTORY/s//HISTORY/
/ HISTORY - /s//MONUMENTATION: /
/ MONUMENTED /s//by/
/^SP_SET/s//SPECIFIC SETTING/
/NATIONAL GRID SPATIAL ADDRESS/d
/COMP$/d
/LAPLACE CORR/d
/ELLIP HEIGHT/d
/HORZ ORDER/d
/ELLP ORDER/d
/GP(/d
/AD(/d
/^$/d
/^ X /d
/^ Y /d
/^ Z /d
/complete/d
/Time/d

SED is a UNIX text tool. From this [http://unxutils.sourceforge.net/ GNU Utilities site], download Unxutils.zip and unzip sed.exe from it.

SED uses a script file and works in DOS mode.

Example of using SED with a script file called dsheet.sed to shorten a .dat file called va059.dat downloaded from the NGS:

  • sed -f dsheet.sed va059.dat > fairfax.txt

will use a script file called dsheet.sed to change the file va059.dat to a shortened version called fairfax.txt

Here is the contents of the script file dsheet.sed made to work on ["NGS"] ["datasheet"]s and this version of the SED program:

/^1/d
/^DATABASE/d
/^  /d
/^ ....../s///
/^  DESIGNATION/s/^  /*/
/^  PID/s/^  /*/
/^  STATE/s/^  /*/
/^  USGS/s/^  /*/
/^       /s/^  /*      /
/MONUMENTED/s/HISTORY/XISTORY/
/^  HISTORY/d
/XISTORY/s//HISTORY/
/^  HISTORY     - /s//*  MONUMENTATION: /
/    MONUMENTED      /s//by/
/^  /d
/^\;/d
/^\!/d
/^\:/d
/^\./d
/STABILITY:/d
/SATELLITE:/d
/SUPERSEDED SURVEY CONTROL/d
/NATIONAL GRID SPATIAL ADDRESS/d
/^|/s// |/
/SP_SET/s//SPECIAL SETTING/
/^$/d
/^./s///

Copy the contents of this box into a text file called dsheet.sed

SED (last edited 2009-03-21 21:03:19 by localhost)