The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
Google UNIX.COM


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
how to read the column and print the values under that column gemini106 Shell Programming and Scripting 6 03-28-2008 03:05 AM
How to check Null values in a file column by column if columns are Not NULLs Mandab Shell Programming and Scripting 7 03-15-2008 05:57 AM
annoying vi yank word + delete all question umen UNIX for Dummies Questions & Answers 4 03-20-2006 04:46 AM
Replace 10th column with a new column--- Terriblly hurry ahmedwaseem2000 Shell Programming and Scripting 2 09-05-2005 10:10 PM
yank giannicello UNIX for Dummies Questions & Answers 5 01-29-2003 10:17 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-08-2006
Registered User
 

Join Date: Apr 2006
Posts: 4
Stumble this Post!
Yank a column in vi

I have a file which has data in columns.
Is there a way to yank columns in vi?
I tried searching in this forum. I did not find it.
Please help me out.
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 04-08-2006
...@...
 

Join Date: Feb 2004
Location: NM
Posts: 3,846
Stumble this Post!
Most versions of vi support the C-x commands.

Try man vi and look for open-rectangle, clear-rectangle, yank-rectangle,
delete-rectangle

If you have a big file and you want to lose,say all of column #5 in the entire file, try awk, it's a lot easier.
Code:
awk ' { print $1, $2, $3 , $5, $6}' oldfile>newfile
Reply With Quote
  #3 (permalink)  
Old 04-08-2006
Registered User
 

Join Date: Apr 2006
Posts: 4
Stumble this Post!
Thanks for the info. I know that this can be done with awk. I wanted to know if there is a way via VI itself.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:08 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0