Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

editing wget file list

3 views
Skip to first unread message

Jens-Olaf Lindermann

unread,
Oct 13, 2009, 11:25:45 AM10/13/09
to

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

unread,
Oct 13, 2009, 12:01:56 PM10/13/09
to
On 2009-10-13, Jens-Olaf Lindermann <jenslin...@yahoo.de> wrote:
> 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$9b4e...@newsspool4.arcor-online.net>

am

unread,
Oct 13, 2009, 12:19:14 PM10/13/09
to
Jens-Olaf Lindermann wrote:

>
> 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
@a Aufruf Makro-a und �berpr�fen, ob das richtige passiert
582@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
@a call macro-a and check the result
582@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.Xm...@Xmeditec-gmbh.com]
31162 Bad Salzdetfurth Internet : www.meditec-gmbh.com

Jens-Olaf Lindermann

unread,
Oct 13, 2009, 12:38:03 PM10/13/09
to

Thank you both very much - it is done! ;-)

J.

0 new messages