Main Page | Report this Page
Computers Forum Index  »  Computer - Editors  »  editing wget file list...
Page 1 of 1    

editing wget file list...

Author Message
Jens-Olaf Lindermann...
Posted: Tue Oct 13, 2009 7:25 pm
Guest
Hi ng

first excuse my English - it probably sounds very 'German'... I have under
debian made a file for wget to download 585 links. The 585 were easy with
the vi... The question is, that the adress is in most parts the same and
only the ending varies. How can I 585 times rename the ending of the line

%22212849_00000001.foobar%22

so that I can count 01.foobar to ..585.foobar? I could retype this by hand
of course, but huh - that seem's annoying. Does anyone of you has an idea?

Jens

--
Debian GNU/Linux [stable]
PGP-Key available -- Fingerprint:
57C8 DE10 79E3 5C24 BFC6 DB02 4632 6900 664F 89B5
 
Christian Brabandt...
Posted: Tue Oct 13, 2009 8:01 pm
Guest
On 2009-10-13, Jens-Olaf Lindermann <jenslindermann at (no spam) yahoo.de> wrote:
Quote:
first excuse my English - it probably sounds very 'German'... I have under
debian made a file for wget to download 585 links. The 585 were easy with
the vi... The question is, that the adress is in most parts the same and
only the ending varies. How can I 585 times rename the ending of the line

%22212849_00000001.foobar%22

so that I can count 01.foobar to ..585.foobar? I could retype this by hand
of course, but huh - that seem's annoying. Does anyone of you has an idea?

Following is a copy of my answer from de.comp.editoren¹:
:%s/_\zs\d\+\ze\.foobar/\=printf("%08d", submatch(0)+line('.')-1)/

regards,
Christian
¹)MID:<4ad4a372$0$6551$9b4e6d93 at (no spam) newsspool4.arcor-online.net>
 
am...
Posted: Tue Oct 13, 2009 8:19 pm
Guest
Jens-Olaf Lindermann wrote:

Quote:

Hi ng

first excuse my English - it probably sounds very 'German'... I have under
debian made a file for wget to download 585 links. The 585 were easy with
the vi... The question is, that the adress is in most parts the same and
only the ending varies. How can I 585 times rename the ending of the line

%22212849_00000001.foobar%22

so that I can count 01.foobar to ..585.foobar? I could retype this by hand
of course, but huh - that seem's annoying. Does anyone of you has an idea?

Jens

English text follows


German Text:
Nimm Makros:
qa Start der Aufzeichnung Makro "a"
yyp Kopieren der Musterzeile und Einfügen. Cursor in 2. Zeile
f_ In der zeile vorwärts, bis zur Zahl
<Strg>a "Ist ein Feature nimmer da, versuchen wir's mit Control-a"
Siehe :help ^a
q Makro beenden
at (no spam) a Aufruf Makro-a und überprüfen, ob das richtige passiert
582 at (no spam) a Die verbeibenden Zahlen generieren.

English Version:
use macros
qa Start macro "a"
yyp Copy, paste. Cursor in 2. row
f_ jump forward in line until number
<CTRL>a very old rhyme from times when there where keyboard-drivers
see :help ^a
q stop macro
at (no spam) a call macro-a and check the result
582 at (no spam) a make the rest of the lines


--
Mit freundlichen Grüßen

Albrecht Mucha
Software Entwicklung
----------------------------------------------------------------------
MediTec GmbH
IT-Lösungen für das Gesundheitswesen
Griesbergstr. 1b-c eMail : [string map {X {}}
a.Xmucha at (no spam) Xmeditec-gmbh.com]
31162 Bad Salzdetfurth Internet : www.meditec-gmbh.com
 
Jens-Olaf Lindermann...
Posted: Tue Oct 13, 2009 8:38 pm
Guest
Thank you both very much - it is done! ;-)

J.

--
Debian GNU/Linux [stable]
PGP-Key available -- Fingerprint:
57C8 DE10 79E3 5C24 BFC6 DB02 4632 6900 664F 89B5
 
 
Page 1 of 1    
All times are GMT
The time now is Mon Dec 07, 2009 8:58 pm