Monday, June 18, 2012

SEG-Y values from the command line - The tape problem

We all love magnetic tape don't we.  Well we have problems with filenames regarding tapes.  Lots of times we can discriminate SEG-Y files on a tape from it's trace header values.

Use this script to zip through lots and lots of indescript files from a tape output.

#!/bin/bash

hexvalue=$(hexdump -C -s 3614x -n 2 $@ | awk '{print $2 $3;}')
let decnum=0x$hexvalue
echo $decnum

Change the 3614 to correspond with what value you want to extract from the headers.

Happy day!