The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 07-15-2006
jim mcnamara jim mcnamara is offline Forum Staff  
...@...
  
 

Join Date: Feb 2004
Location: NM
Posts: 5,800

Code:
awk ' {
        if (NR==1){
            if( $1 ~ /^[A-Za-z0-9]/) {print $0}
        }
}' file1

If I understand what you want. ^[stuff] means match this at the start of the line
or

Code:
sed '1q' file1 | grep '^[a-zA-Z0-9]'