Re: Search and write

2011-09-01 Thread Lars Iselid
Thanks for help! I want to write the digits and actually my full regex in vim is: /[-0-9]\{13,17\} I want numbers with 13 to 17 digits even if they have hyphens between the digits. Should then be something like: :g/[-0-9]\{13,17\}/t.|s/[^0-9]\+//g|w! my.txt | d I tried this but I get the

Re: Search and write

2011-09-01 Thread Marcin Szamotulski
On 08:10 Thu 01 Sep , Lars Iselid wrote: Thanks for help! I want to write the digits and actually my full regex in vim is: /[-0-9]\{13,17\} I want numbers with 13 to 17 digits even if they have hyphens between the digits. Should then be something like:

Re: Search and write

2011-09-01 Thread Lars Iselid
Ok, I've changed to: :g/[-0-9]\{13,17\}/t.|s/^[0-9]\+//g|w! my.txt | d I still not just get the 13 to 17 digits strings. You say it will copy all the lines that starts with digits. I don't want the whole line just the digit string, not what follows with exception if it's another 13 to 17 digits

Re: Search and write

2011-09-01 Thread Christian Brabandt
Hi Lars! On Do, 01 Sep 2011, Lars Iselid wrote: Ok, I've changed to: :g/[-0-9]\{13,17\}/t.|s/^[0-9]\+//g|w! my.txt | d I still not just get the 13 to 17 digits strings. You say it will copy all the lines that starts with digits. I don't want the whole line just the digit string, not what

Re: Search and write

2011-09-01 Thread Lars Iselid
Still gets the whole content to the my.txt file. How to not write the whole buffer? Lars Iselid On Thu, Sep 1, 2011 at 12:24 PM, Christian Brabandt cbli...@256bit.orgwrote: Hi Lars! On Do, 01 Sep 2011, Lars Iselid wrote: Ok, I've changed to: :g/[-0-9]\{13,17\}/t.|s/^[0-9]\+//g|w!

Re: Search and write

2011-09-01 Thread Christian Brabandt
Hi Lars! On Do, 01 Sep 2011, Lars Iselid wrote: Still gets the whole content to the my.txt file. How to not write the whole buffer? Please show the exact command you used. regards, Christian -- -- You received this message from the vim_use maillist. Do not top-post! Type your reply below

Re: Search and write

2011-09-01 Thread Lars Iselid
Checked carefully again and I had missed a point. Sorry! But in my result each string of digits (10 to 17) from same line (or paragraph) is sorted in one string without spaces. How to get the output sorted in one column with each string of digits in each row? Or at least spaces between each string

Re: Search and write

2011-09-01 Thread Christian Brabandt
Hi Lars! On Do, 01 Sep 2011, Lars Iselid wrote: Checked carefully again and I had missed a point. Sorry! But in my result each string of digits (10 to 17) from same line (or paragraph) is sorted in one string without spaces. How to get the output sorted in one column with each string of

Re: Search and write

2011-09-01 Thread Tim Chase
On 09/01/11 01:10, Lars Iselid wrote: I want to write the digits and actually my full regex in vim is: /[-0-9]\{13,17\} I want numbers with 13 to 17 digits even if they have hyphens between the digits. For this, I'd tend to do something like put each match on its own line and then delete all

Search and write

2011-08-31 Thread Lars Iselid
If you have a search statement something like this: /[0-9] And want to write :w the matching content to a file. How to do? I've seen examples similar to this: /[0-9] . w my.txt But exactly this doesn't work for me. -- You received this message from the vim_use maillist. Do not top-post!

Re: Search and write

2011-08-31 Thread Tim Chase
On 08/31/11 07:23, Lars Iselid wrote: If you have a search statement something like this: /[0-9] And want to write :w the matching content to a file. How to do? I've seen examples similar to this: /[0-9] . w my.txt Depends on whether you want to write just the match, or the entire line.