Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F28388247
raw.txt
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Authored By
•
Gilles
Mar 14 2019, 4:17 PM
2019-03-14 16:17:39 (UTC+0)
Size
696 B
Referenced Files
None
Subscribers
None
raw.txt
View Options
import subprocess
input_file = '/mnt/data/xmldatadumps/public/svwiki/20190301/svwiki-20190301-pages-meta-history.xml.bz2'
output = subprocess.check_output(['getlastidinbz2xml', '-f', input_file, '--type', 'page'])
revid = int(output.split(':')[1])
file_id = 0
step = 1000000
fspec = []
for range_start in range(0, revid, step):
file_id += 1
range_end = range_start + step
if range_start == 0:
range_start = 1
if range_end > revid:
range_end = revid
fspec.append('svwiki-%02d.bz2:%d:%d' % (file_id, range_start, range_end))
fspec = ','.join(fspec)
command = ['writeuptopageid', '-fspec', fspec, '-i', input_file, '-odir', '.']
print(' '.join(command))
subprocess.call(command)
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
7181819
Default Alt Text
raw.txt (696 B)
Attached To
Mode
P8201 splitdump.py
Attached
Detach File
Event Timeline
Log In to Comment