1

Zipcode + 4 change to Zipcode

view story
linux-howto

http://www.unix.com – I'm doing some integrity checeking. I Have found if the file contains an "invalid" entry (Zipcode +4). What I'm looking to do is modify the data so that it's just the 5 digit zipcode. I found a couple of helpful posts, but nothing that I could apply to my situation. Here's a sample input (note that there could be multiple entries per file, and it would appear as one line) <Name> Joe</Name><LName>Smith</LName><Zipcode>12345-7132</Zipcode> I'd like to rewrite the Zipcode data to just be <Zipcode>12345</Zipcode> This is the grep I'm u (HowTos)