APLawrence.com -  Resources for Unix and Linux Systems, Bloggers and the self-employed

Replace 10th tab


© December 2004 (various authors)

If this isn't exactly what you wanted, please try our Search (there's a LOT of techy and non-techy stuff here about Linux, Unix, Mac OS X and just computers in general!):

Subject: Re: Shell script question.
References: <8d58e154.0112260154.61df2a30@posting.google.com>
From: spcecdt@deeptht.armory.com (John DuBois)
Date: 27 Dec 2001 00:22:27 GMT

In article <8d58e154.0112260154.61df2a30@posting.google.com>,
Filip Verborgh <filip.verborgh@fidro-zedelgem.be> wrote:
>I would like to replace the 10th TAB (separator between field 10 and
>field 11) by another character (eg. "-").

If you have a recent version of gawk (I forget which version gensub() appeared
in), this can be done in a particularly straightforward manner:



gawk '{print gensub("\t","-",10)}'

"replace the 10th instance of tab with '-' and print the result"

        John
-- 
John DuBois  spcecdt@armory.com  KC6QKZ/AE  https://www.armory.com/~spcecdt/
 

Got something to add? Send me email.





(OLDER)    <- More Stuff -> (NEWER)    (NEWEST)   

Printer Friendly Version

->
-> Replace 10th tab ––>Re: Shell script question.


Inexpensive and informative Apple related e-books:

Take Control of Apple Mail, Third Edition

iOS 8: A Take Control Crash Course

Take Control of Preview

Are Your Bits Flipped?

Take Control of OS X Server





Printer Friendly Version

Have you tried Searching this site?

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more.

Contact us


Printer Friendly Version





Anyone even peripherally involved with computers agrees that object-oriented programming (OOP) is the wave of the future. Maybe one in 50 of them has actually tried to use OOP – which has a lot to do with its popularity (Steve Steinberg)




Linux posts

Troubleshooting posts


This post tagged:

SCO_OSR5



Unix/Linux Consultants

Skills Tests

Unix/Linux Book Reviews

My Unix/Linux Troubleshooting Book

This site runs on Linode





SCO Unix Sales, Support, & Service

Phone:  707-SCO-UNIX (707-726-8649Toll Free: 833-SCO-UNIX (833-726-8649)
www.SCOsales.com