Deleting some lines from a log file
Hi I have to clean up a log file. I want to exclude/delete lines that start with a number or "MPRINT" : ENTRY 184 185 **; 186 * PGMs Complexes 1 : enable - O : disable *; 187 **;123 188 189 %include "&pgm.MainComplex.sas"; ** Macro principale Base et Queries **; NOTE: %INCLUDE (level 1) file E:\IFM 2005-01\gravure_2007_03_15\BRD_04-11-J\Database\Programs\MainComplex.sas is file E:\IFM 2005-01\gravure_2007_03_15\BRD_04-11-J\Database\Programs\MainComplex.sas. 269 +**; MPRINT(MAINCOMPLEX): **; RESULT : NOTE: %INCLUDE (level 1) file E:\IFM 2005-01\gravure_2007_03_15\BRD_04-11-J\Database\Programs\MainComplex.sas is file E:\IFM 2005-01\gravure_2007_03_15\BRD_04-11-J\Database\Programs\MainComplex.sas. **; I first tyred to identify all numbers at a beginning of a line, but for instance when doing a substitution I cannot find the good regex (for a try :%s/^[0-9]*/TEST/ didn't work). Can you tell me how I have to do to delete those lines beginning by numbers or MPRINT from my file ? Many thanks. Eddine.
Re: Deleting some lines from a log file
Afterwards It seems so simple with your help Many thanks to you Tom, Tim and Vim community ! Eddine 2007/3/27, Tom Whittock <[EMAIL PROTECTED]>: :g/^MPRINT/d :g/^\d\+/d should do more or less what you want. Cheers.
Pasting a vertical selection.
Hello Vimmers, I have to correct some datafiles, and I need to paste a column in the middle of my text file to replace the older column which contain bad values. How can I do that ? Just to illustrate my question, I would like to paste in Vim a column the same way you would do on a speadsheet that is to say, this should not change the total number of lines... Hope I have been clear enough, thank you by advance for your precious help. Regards, Eddine.
Re: Pasting a vertical selection.
Fisrt of all thank you Max for your quick answer. This solution, doesn't seem to work, when I try to paset with "p" over my selection, instead of replacing with the values of my new column, vim insert it... I have the feeling I should type a command such withc would be a mix of vertical-selction-"R"-and-"p"... 2006/6/20, Max Dyckhoff <[EMAIL PROTECTED]>: 1. Use Ctrl-V and the arrow keys to block select the text that you want to paste. 2. Yank the text with y. 3. Block select the text that you want to replace. 4. Paste over the selection with the text you copied by pressing p. Of course if the text you copy in is a different number of lines then it won't work properly, but otherwise you should be happy! Max
Vim Script : How to Delete a buffer or exit Vim at the end of a treatment ?
Hi, I'm using a vim script to make some data formating. I source it from the original file I want to process and the script produces me a new file. I would like to add commands that whether emply the buffer list or exit Vim once I'm done. I tried to add :bd :bd :q or bd bd q or even :bd :bd :q at the end of my script, but I can't get the desired effect ? Could you help me please ? Thank you. Eddine.
How to always open file in a tab ?
Hello all, I'd like to take advantage of tab file editing, thus is it possible to modify windows registry base or is there any work around to _always_ open files in a tab ? Once again thank you bay advance for your precious help. Best regards Eddine.
Re: How to always open file in a tab ?
Thank you Srini. Is it possible to have this behaviour with the right-click "Edit in (single) Vim" context menu under win32 ?
How can I do to always opening files into a tab ?
Hello Vimmers ! I got few questions for vim under win32 (XP) - How can I do to _always_ open files into its own tab ? --> Also is there a way to set an option so this tip also runs with the "Edit with Vim" context menu. - Is there an option so when a file is vertically splitted, scrolling down and up, keeps both left and right panel on the same line, in a way is there a mean to synchronize the up and down scrolling of both views ? Hope I have been clear enough with my questions. Many thanks and regards ! Eddine.
Re: How can I do to always opening files into a tab ?
I guess "scrollbind" is OK for my need, I was trying to have the same behaviour as when you edit files in diff mode. Thank you very much for all of you who helped me ! -- Eddine
Key Mapping for spellcheck.
Hi, I would like to map the right-clic-key (to make myself clear it's the one between Win flag and Ctrl key) so I can have the suggestion when I'm spellchecking a file. How is it named under vim ? Thank you for your help Eddine.
Re: Key Mapping for spellcheck.
Thank you for your response, it you will save me much time looking a mapping that doesn't not exist as I expected. Thank you. Not sure Vim sees that key. In Insert mode, try hitting Ctrl-V (or Ctrl-Q if you use Ctrl-V to paste) followed by the key in question. If something is inserted in your buffer, that's (probably) how your version of Vim sees the key. If nothing is inserted, or if something else happens (e.g., a menu opens) then Vim doesn't see the key. You might try changing the status of the 'winaltkeys' setting to see if it makes any difference. Best regards, Tony.
Multiline file appearing in one line under Vim
Hi all, I have a file which behaves differently whether edited with win32 Notepad and gVim. When opened in notepad I got several lines, which is the most convenient "layout" for me, but when opened in gVim I got the file in only one line. I tried to set "ff" to "dos" but it does not have any effect. Does any one have a clue ? How can I do to have the file edited in several lines ? What have I missed ? Thank you. Eddine.
Multiline file appearing in one line under Vim
I'm attaching the file so you can have a better idea. And it's not a problem of wrapped unwrapped option on Vim. The file is indeed converted from EBCDIC format to ASCII (through dd command) it could explain but I won't able to say why. Eddine. 90021865300028 186520201052A0059016049E 01459643 270720010925 FRAMO09082001 014 432 EURR+008186110+0+0+0+0+0+00311598012 +0+0+0+0+0+0+000 +0+0+0+0+0+0+000 +0+0+0+0+0+0+000 +0+0+0+0+0+0+000 14150 0001N07145WE14 1 DTY 101930785 90021865 300028 186520201512001 60015565 01532786 12072001O FRAMC0509200109052006 110 431 EURR+000100690+0+0+0+0+0+012 +0+0+0+0+0+0+000 +0+0+0+0+0+0+000 +0+0+0+0+0+0+000 +0+0+0+0+0+0+000 MAIRIE DE PARIS99000 000 1N0693NNS75 1 FES 203263576 90021865300028 186520201063ZB A0059037655Q 03600316 040420031450 06000FRAMO17042003 011 932 EURR+00100+0+0+0+0+0+01226 EURR+000145368+0+0+0+0+0+012 +0+0+0+0+0+0+000 +0+0+0+0+0+0+000 +0+0+0+0+0+0+000 BRIOLA OLIVIER 06230 244AYB062484150137G 1O1537AYT06 CHAKI ABDELGHANI 1 SPG 340008714
Re: Multiline file appearing in one line under Vim
2006/5/17, Georg Dahn <[EMAIL PROTECTED]>: Hi! My guess is: notepad breaks at column 1024. In notepad the first two lines of your file have exact 1024 characters. This could be a notepad limitation. Best wishes, Georg Is there a way to make profit of this kind of limitation. Or is there a way to cut the single line so I can have n lines of the same L length ?
Vertical selection
Hi all, Is it possible to make a vertical selection in a text, to have a rectangular selection in the text ? If so, how ? thank you, best regads. Eddine
Deleting lines from L1 to L2 in Vim script
Hi, I would like to to delete line from L1 to L2, I try to script that but obviously commands are different for a script. What is the right thing to do ? Thank you. Eddine.
Re: Deleting lines from L1 to L2 in Vim script
OK thank you for your help. And how about deleting from line L1 for instance to the end of the file. And put it in a script file, since "G" don't appear like a regexp and $ represent end of line if I'm not wrong ?