RE: Semi-OT: Vi Question/Need

  • From: "Powell, Mark" <mark.powell2@xxxxxx>
  • To: "oracle-l@xxxxxxxxxxxxx" <oracle-l@xxxxxxxxxxxxx>
  • Date: Fri, 15 Mar 2013 20:11:45 +0000

My error.  I tried mapping a key sequence that moved a specific spot on a line 
then deleted to the end but my normal global command syntax of :1,$ would not 
except the mapped character as input so the best I could come up with was 
mapping the above then adding j0 to advance to the start of the next line but 
you have to hit enter once for every line.

At this point I would probably move on to looking at using sed or awk, but I 
noticed the reply that just suggested changing the output format for the plan 
to basic which solves the problem.


-----Original Message-----
From: Christopher.Taylor2@xxxxxxxxxxxx 
[mailto:Christopher.Taylor2@xxxxxxxxxxxx] 
Sent: Friday, March 15, 2013 3:07 PM
To: Powell, Mark; oracle-l@xxxxxxxxxxxxx
Subject: RE: Semi-OT: Vi Question/Need

Except I wanted to do it in one command through the whole file using 
search/replace.

Basically, search for cursor postion X, then delete to end of line through each 
line of the file.

Shift-D requires me to position the cursor using the keys to the cursor 
position on each line and hit shift-d.

Chris


-----Original Message-----
From: Powell, Mark [mailto:mark.powell2@xxxxxx] 
Sent: Friday, March 15, 2013 1:48 PM
To: Taylor Christopher - Nashville; oracle-l@xxxxxxxxxxxxx
Subject: RE: Semi-OT: Vi Question/Need

You mean <shift>d    delete to end of line  ?


-----Original Message-----
From: oracle-l-bounce@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Christopher.Taylor2@xxxxxxxxxxxx
Sent: Friday, March 15, 2013 9:36 AM
To: oracle-l@xxxxxxxxxxxxx
Subject: Semi-OT: Vi Question/Need

What is the simplest way to delete from a line POSITION to end of line through 
the whole file?  The piece I can't figure out is to start the delete/strip 
portion at a specific line position on a line.
Here's what I'm looking at:

At Id0 (line 4) I want to strip everything from position 73 (the 4th PIPE to 
end of line).  I can't seem to find the right combo of search/replace.

(The reason for doing this is I can strip that off for 2 plans and then compare 
the plans using WinMerge to quickly id the diffs.

----------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                        | Name                         | 
E-Rows |E-Bytes| Cost (%CPU)| E-Time   | Pstart| Pstop |
----------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT                 |                              |       
 |       | 83263 (100)|          |       |       |
|   1 |  HASH UNIQUE                     |                              |     
77 |  9779 | 83263   (1)| 00:06:13 |       |       |
|   2 |   FILTER                         |                              |       
 |       |            |          |       |       |
|   3 |    HASH JOIN ANTI                |                              |   
1107 |   137K| 83262   (1)| 00:06:13 |       |       |
|   4 |     HASH JOIN                    |                              |   
1149 |   126K| 82910   (1)| 00:06:11 |       |       |
|   5 |      VIEW                        | index$_join$_004             |   
2172 | 30408 |   358   (2)| 00:00:02 |       |       |
|   6 |       HASH JOIN                  |                              |       
 |       |            |          |       |       |
|   7 |        INDEX FAST FULL SCAN      | PAYER_PK                     |   
2172 | 30408 |   148   (2)| 00:00:01 |       |       |
|   8 |        INDEX FAST FULL SCAN      | PAYER_UK                     |   
2172 | 30408 |   208   (1)| 00:00:01 |       |       |
|   9 |      HASH JOIN                   |                              |   
4818 |   465K| 82552   (1)| 00:06:09 |       |       |
|  10 |       PARTITION LIST SINGLE      |                              |  
25467 |   596K|  1871   (1)| 00:00:09 |   KEY |   KEY |
|  11 |        TABLE ACCESS FULL         | MON_ACCOUNT                  |  
25467 |   596K|  1871   (1)| 00:00:09 |    28 |    28 |
|  12 |       TABLE ACCESS BY INDEX ROWID| MON_ACCOUNT_PAYER            |    
110K|  3775K| 34594   (1)| 00:02:35 |       |       |
|  13 |        NESTED LOOPS              |                              |    
320K|    22M| 80676   (1)| 00:06:01 |       |       |
|  14 |         VIEW                     | index$_join$_003             |      
3 |   120 |     3   (0)| 00:00:01 |       |       |
|  15 |          HASH JOIN               |                              |       
 |       |            |          |       |       |
|  16 |           INDEX FAST FULL SCAN   | MON_STATUS_IDX01             |      
3 |   120 |     1   (0)| 00:00:01 |       |       |
|  17 |           INDEX FAST FULL SCAN   | MON_STATUS_UK                |      
3 |   120 |     1   (0)| 00:00:01 |       |       |
|  18 |         INDEX RANGE SCAN         | MON_ACCT_PAYER_FK_MON_STATUS |    
114K|       |   225   (2)| 00:00:02 |       |       |
|  19 |     PARTITION LIST SINGLE        |                              |  
75699 |  1034K|   350   (1)| 00:00:02 |   KEY |   KEY |
|  20 |      INDEX RANGE SCAN            | WQ_ORG_ACCOUNT_PK            |  
75699 |  1034K|   350   (1)| 00:00:02 |    31 |    31 |
|  21 |    VIEW                          | index$_join$_005             |      
1 |    10 |     1 (100)| 00:00:01 |       |       |
|  22 |     HASH JOIN                    |                              |       
 |       |            |          |       |       |
|  23 |      INDEX RANGE SCAN            | MON_STATUS_PK                |      
1 |    10 |     0   (0)|          |       |       |
|  24 |      INLIST ITERATOR             |                              |       
 |       |            |          |       |       |
|  25 |       INDEX RANGE SCAN           | MON_STAT_FK_MON_STAT_CAT     |      
1 |    10 |     4   (0)| 00:00:01 |       |       |
|  26 |     TABLE ACCESS BY INDEX ROWID  | MON_PROJECT                  |      
1 |     9 |     1   (0)| 00:00:01 |       |       |
|  27 |      INDEX UNIQUE SCAN           | MON_PROJECT_PK               |      
1 |       |     0   (0)|          |       |       |
----------------------------------------------------------------------------------------------------------------------------------

Chris Taylor
Oracle DBA
Parallon IT&S



--
//www.freelists.org/webpage/oracle-l


--
//www.freelists.org/webpage/oracle-l


Other related posts: