The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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




Thread: mask ID number
View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #1 (permalink)  
Old 07-20-2007
lyoncc lyoncc is offline
Registered User
  
 

Join Date: May 2007
Posts: 21
mask ID number

HP-UX 11i v2. #!/bin/sh

Hi all.

I have a flat file like this with lines like this:

|07/19/07|08:26AM|1|CupsCoffee|CupsCo|989898989 |Doe, John Y |THE PLUS CARD - Price| | |Y| | 2.00|

I would like to replace the id number (field 6) with a masked version, ie *****8989. Everything else stays the same. The field is always 9 characters. I was thinking about sed or maybe tr.

Thanks in advance!!!!