Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Awk > Re: Print field...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 20 of 24 Topic 2212 of 2341
Post > Topic >>

Re: Print fields starting with N to the end of line.

by pk <pk@[EMAIL PROTECTED] > Mar 31, 2008 at 06:15 PM

Ed Morton wrote:

> You live & learn. I've never seen setting NF to a lower value used to
> truncate the record before.

But, isn't

awk 'NF--' file.txt

a common idiom to remove last field in each line of a file (assuming each
line has at least one field)?

Thanks

-- 
All the commands are tested with bash and GNU tools, so they may use
nonstandard features. I try to mention when something is nonstandard (if
I'm aware of that), but I may miss something. Corrections are welcome.
 




 24 Posts in Topic:
Print fields starting with N to the end of line.
Peter <volkov.peter@[E  2008-03-30 11:12:35 
Re: Print fields starting with N to the end of line.
pk <pk@[EMAIL PROTECTE  2008-03-30 20:47:04 
Re: Print fields starting with N to the end of line.
Ed Morton <morton@[EMA  2008-03-30 13:34:59 
Re: Print fields starting with N to the end of line.
"Rajan" <svr  2008-03-30 15:25:31 
Re: Print fields starting with N to the end of line.
Luuk <Luuk@[EMAIL PROT  2008-03-30 23:57:26 
Re: Print fields starting with N to the end of line.
"Rajan" <svr  2008-03-30 21:18:15 
Re: Print fields starting with N to the end of line.
Luuk <Luuk@[EMAIL PROT  2008-03-31 13:14:16 
Re: Print fields starting with N to the end of line.
pk <pk@[EMAIL PROTECTE  2008-03-31 13:48:17 
Re: Print fields starting with N to the end of line.
Luuk <Luuk@[EMAIL PROT  2008-03-31 14:01:48 
Re: Print fields starting with N to the end of line.
pk <pk@[EMAIL PROTECTE  2008-03-31 14:24:17 
Re: Print fields starting with N to the end of line.
Janis Papanagnou <Jani  2008-03-31 19:54:37 
Re: Print fields starting with N to the end of line.
Janis Papanagnou <Jani  2008-03-31 19:56:05 
Re: Print fields starting with N to the end of line.
pk <pk@[EMAIL PROTECTE  2008-04-01 09:48:02 
Re: Print fields starting with N to the end of line.
Ed Morton <morton@[EMA  2008-04-01 08:11:14 
Re: Print fields starting with N to the end of line.
Ed Morton <morton@[EMA  2008-03-31 07:03:39 
Re: Print fields starting with N to the end of line.
Luuk <Luuk@[EMAIL PROT  2008-03-31 14:10:01 
Re: Print fields starting with N to the end of line.
Ed Morton <morton@[EMA  2008-03-31 07:13:53 
Re: Print fields starting with N to the end of line.
Barry Fishman <barry_f  2008-03-31 13:45:27 
Re: Print fields starting with N to the end of line.
Ed Morton <morton@[EMA  2008-03-31 10:47:10 
Re: Print fields starting with N to the end of line.
pk <pk@[EMAIL PROTECTE  2008-03-31 18:15:35 
Re: Print fields starting with N to the end of line.
Ed Morton <morton@[EMA  2008-03-31 11:29:11 
Re: Print fields starting with N to the end of line.
Janis Papanagnou <Jani  2008-03-31 20:01:12 
Re: Print fields starting with N to the end of line.
Janis <janis_papanagno  2008-04-01 00:39:44 
Re: Print fields starting with N to the end of line.
pk <pk@[EMAIL PROTECTE  2008-04-01 10:11:43 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Aug 27 17:53:03 CDT 2008.