[Pywikipedia-l] problem with replace.py

Maarten Dammers maarten at mdammers.nl
Sun Jan 16 11:29:25 UTC 2011


Hi guys,

Op 16-1-2011 12:20, Bináris schreef:
> What does it mean "didn’t work at all"? What have you seen on the screen?
> Are you sure those are really empty, and no space in them?
>
> By the way, now I remember, that earlier I had problems, too, when I 
> wanted to substitute a newline (searching works well).
Try using \r\n for finding the newline, so someting like "\|\r\n\|-" 
"|Yes\n|-"

Maarten
>
> 2011/1/16 CobraSA <CobraSA at live.com <mailto:CobraSA at live.com>>
>
>     Hi
>     Thanks for helping
>     D:\Development\pywikibot>python replace.py -cat:Dumpers -regex
>     "\|\n\|-" "\|Yes\n\|-"
>     didn’t work at all
>     and without the \ before |  it sort of freeze
>     *From:* Bináris <mailto:wikiposta at gmail.com>
>     *Sent:* Sunday, January 16, 2011 11:39 AM
>     *To:* Pywikipedia discussion list
>     <mailto:pywikipedia-l at lists.wikimedia.org>
>     *Subject:* Re: [Pywikipedia-l] problem with replace.py
>     And it is likely that once you have specified -regex, you have to
>     type \| instead of |, because | has a special meaning in regexes.
>
>     2011/1/16 Bináris <wikiposta at gmail.com <mailto:wikiposta at gmail.com>>
>
>         First, you must specify -regex in the command if you want "\n"
>         to mean a newline instead of literal \n.
>         Second, "-cat:Dumpers" is not correct, use -cat:"Dumpers" or
>         simply -cat:Dumpers instead, if you want to work with this
>         category. ("" is only necessary if your category name has a
>         space.)
>
>         2011/1/16 CobraSA <CobraSA at live.com <mailto:CobraSA at live.com>>
>
>             command: D:\Development\pywikibot>python replace.py
>             "-cat:Dumpers" "|\n|-" "|Yes\n|-"
>             It makes no chnge even the the dumpers page are full of
>             tables with | empty followed by |-
>             any help please?
>             _______________________________________________
>             Pywikipedia-l mailing list
>             Pywikipedia-l at lists.wikimedia.org
>             <mailto:Pywikipedia-l at lists.wikimedia.org>
>             https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
>
>
>
>
>         -- 
>         Bináris
>
>
>
>
>     -- 
>     Bináris
>
>     ------------------------------------------------------------------------
>     _______________________________________________
>     Pywikipedia-l mailing list
>     Pywikipedia-l at lists.wikimedia.org
>     <mailto:Pywikipedia-l at lists.wikimedia.org>
>     https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
>
>     _______________________________________________
>     Pywikipedia-l mailing list
>     Pywikipedia-l at lists.wikimedia.org
>     <mailto:Pywikipedia-l at lists.wikimedia.org>
>     https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l
>
>
>
>
> -- 
> Bináris
>
>
> _______________________________________________
> Pywikipedia-l mailing list
> Pywikipedia-l at lists.wikimedia.org
> https://lists.wikimedia.org/mailman/listinfo/pywikipedia-l

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wikimedia.org/pipermail/pywikipedia-l/attachments/20110116/7ca7c51e/attachment.htm 


More information about the Pywikipedia-l mailing list