![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| repeat pattern without using excel | ajp7701 | Shell Programming and Scripting | 3 | 03-15-2008 12:28 AM |
| Repeat last entered command ? | vilius | Shell Programming and Scripting | 5 | 09-25-2007 07:15 AM |
| to copy and repeat | falcondown01 | Shell Programming and Scripting | 4 | 09-07-2007 09:15 PM |
| Limitations of awk? Good idea? Bad idea? | yongho | Shell Programming and Scripting | 2 | 06-08-2005 06:18 PM |
| Repeat Commands | dereckbc | UNIX for Dummies Questions & Answers | 6 | 01-04-2005 11:15 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
any idea to repeat a action in VI
Any idea to repeat an action to all the lines in vi...
suppose i want to delete the first word from all the lines in VI .. how would i do it ? in general i am also looking for a way to apply a action to all the lines in VI . |
|
|||||
|
Hi,
If you want to repeat an action, you use the . (dot)... Check this out for more ! http://csep1.phy.ornl.gov/unix_guide...00000000000000 |
|
|||||
|
Hi,
vi is a very powerful tool. explore it to do something over a number of lines you need to use :<startline>,<endline> command besides this vim provides recording. however, i wud suggest you that try to use some external scripts like awk, sed etc to do such things. |
|
||||
|
Q1:
Example1: cat testfile 111 222 333 444 aaa bbb ccc ddd 111 222 333 444 In vi mode, step to remove first word. press 'Esc' : prompt appear then type %s/.[^ ]* *// "%" is represented to whole document Example2: cat testfile 111 222 333 444 aaa bbb ccc ddd 111 222 333 444 In vi, step to remove lines selectively |
|
||||
|
oh sorry, press wrong key to post the previous message.
The remains are shown as follows: press 'Esc' : prompt appear then type .,1000s/.[^ ]* .[^ ]* // it will remove first two words of each line from "current line to line 1000"(.,1000). |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|