Created
May 10, 2017 15:52
-
-
Save mxposed/f959a4289f37b786804c73aa4ec1a9a8 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
a = """ | |
"Le,88 | |
leaving,88 | |
lengths,88 | |
Linen,88 | |
lithographs.,88 | |
mezzotint" | |
",88 | |
Militaria,88 | |
naval,88 | |
Octagonal,88 | |
pattern;,88 | |
Paysage,88 | |
pepperette,88 | |
PERSIA,88 | |
phénix,88 | |
photographies,88 | |
pigment.,88 | |
plaque;,88 | |
Portriga,88 | |
rain,88 | |
rear" | |
",88 | |
ressaut,88 | |
reversible,88 | |
rib" | |
",88 | |
rocailles,88 | |
RUG" | |
",88 | |
saints,88 | |
seals.,88 | |
secondary,88 | |
sèvres,88 | |
shell.,88 | |
spectacle-set,88 | |
stemmed,88 | |
struttura,88 | |
stylish,88 | |
TAPERING,88 | |
TIMBRATO,88 | |
toast,88 | |
toggle" | |
",88 | |
view" | |
",88 | |
Willem,88 | |
wingback,88 | |
X-form,88 | |
Zeppelin,88 | |
108,89 | |
(14,89 | |
1780,89 | |
1922" | |
",89 | |
1954" | |
",89 | |
1958,89 | |
24in,89 | |
40.5,89 | |
anni,89 | |
BAND,89 | |
belly,89 | |
bible,89 | |
black-and-white,89 | |
buccellati,89 | |
cattle,89 | |
cellulose,89 | |
censer;,89 | |
ces,89 | |
character" | |
",89 | |
China.,89 | |
circles" | |
",89 | |
clip-brooch" | |
",89 | |
COAT,89 | |
collection" | |
",89 | |
Costume,89 | |
crystalline,89 | |
cushions.,89 | |
defined,89 | |
device" | |
",89 | |
diamants" | |
",89 | |
Dog,89 | |
DRAWING,89 | |
Dunhill,89 | |
dure,89 | |
Ebony,89 | |
EMILE,89 | |
ENAMEL" | |
",89 | |
Essencia--Vintage,89 | |
EWER,89 | |
feetSize:,89 | |
folding" | |
",89 | |
foliate-cast,89 | |
forehead,89 | |
formica" | |
",89 | |
goblets,89 | |
granite" | |
",89 | |
Graphics,89 | |
hairy,89 | |
Hallmarked,89 | |
harlequin,89 | |
incis?,89 | |
Incised,89 | |
kashan,89 | |
lacustre,89 | |
LADY,89 | |
lampshade,89 | |
madder,89 | |
maeght" | |
",89 | |
maillons,89 | |
mercedes,89 | |
Merlot--Vintage,89 | |
Navy,89 | |
noire.,89 | |
OPALESCENT,89 | |
or.,89 | |
paper<br,89 | |
paperweight" | |
",89 | |
PHILIPPE,89 | |
Piaget,89 | |
platters" | |
",89 | |
Produced,89 | |
rayon,89 | |
register" | |
",89 | |
remaining,89 | |
Rosenthal,89 | |
SCONCES,89 | |
sculptés,89 | |
selenium,89 | |
sons,89 | |
sovereigns" | |
",89 | |
SPOONS,89 | |
tecnica,89 | |
thick-walled,89 | |
tight,89 | |
tile" | |
",89 | |
Tom,89 | |
travertine,89 | |
trio,89 | |
TWENTY,89 | |
variations,89 | |
vaseline,89 | |
watches" | |
",89 | |
weigh,89 | |
wife,89 | |
xuan,89 | |
yarn,89 | |
1957,90 | |
A),90 | |
and" | |
",90 | |
annular,90 | |
aquatint.,90 | |
bajixiang,90 | |
bat" | |
",90 | |
behind" | |
",90 | |
besetzt,90 | |
BRILLIANT-CUT,90 | |
browned.,90 | |
bts),90 | |
Buddhistic,90 | |
buildings" | |
",90 | |
bust" | |
",90 | |
canister,90 | |
cascading,90 | |
Christmas,90 | |
clasp;,90 | |
clasping,90 | |
Collage" | |
",90 | |
collars" | |
",90 | |
corps" | |
",90 | |
c-prints,90 | |
creamy-white,90 | |
dec,90 | |
dorés" | |
",90 | |
doves,90 | |
Eleven,90 | |
faces" | |
",90 | |
father,90 | |
footrim,90 | |
galloping,90 | |
goutte" | |
",90 | |
HEXAGONAL,90 | |
high-firing,90 | |
huanghuali" | |
",90 | |
incrustés,90 | |
Kakiemon,90 | |
Karton,90 | |
KPM,90 | |
l'acide,90 | |
ladies',90 | |
LEONETTO,90 | |
Medium,90 | |
mould-blown,90 | |
mouse,90 | |
nanako,90 | |
nickel" | |
",90 | |
Ornate,90 | |
Papillon,90 | |
pellet,90 | |
Platinum-palladium,90 | |
polar,90 | |
polyamide,90 | |
provenance:,90 | |
purplish,90 | |
rehaussées,90 | |
rich" | |
",90 | |
rigid,90 | |
RINGThe,90 | |
robustly,90 | |
romains,90 | |
Russell,90 | |
scripts,90 | |
sh,90 | |
sifter,90 | |
silkscreened,90 | |
six" | |
",90 | |
SOUTHERN,90 | |
sporting,90 | |
sprays;,90 | |
sticker,90 | |
sul,90 | |
(sur,90 | |
thickly,90 | |
us,90 | |
vajra,90 | |
wells,90 | |
1/2-inch,91 | |
1952,91 | |
1960s,91 | |
19th/early,91 | |
2008,91 | |
academy,91 | |
(accidents,91 | |
acier" | |
",91 | |
Acrilico,91 | |
amber-coloured" | |
",91 | |
baked,91 | |
bijoux" | |
",91 | |
bleu.,91 | |
brut:,91 | |
centrepiece" | |
",91 | |
charger;,91 | |
citrines,91 | |
clair" | |
",91 | |
cloth-covered,91 | |
col" | |
",91 | |
colonial,91 | |
colorfully,91 | |
Conical,91 | |
Cooper,91 | |
Coriander,91 | |
couple" | |
",91 | |
couvertures,91 | |
cub,91 | |
d'origine.,91 | |
(E" | |
",91 | |
encadrant,91 | |
encre" | |
",91 | |
English" | |
",91 | |
facings,91 | |
finder,91 | |
flanged,91 | |
flat" | |
",91 | |
foreWorldwide,91 | |
froid" | |
",91 | |
frolicking,91 | |
gandhara" | |
",91 | |
Giclee,91 | |
GRAND,91 | |
grease,91 | |
GUANYIN,91 | |
gutem,91 | |
Hall" | |
",91 | |
haunches,91 | |
heel,91 | |
ii" | |
",91 | |
include;,91 | |
indicator,91 | |
inro,91 | |
Inside,91 | |
LADIES,91 | |
madeira,91 | |
mammoth-plate,91 | |
Meiping,91 | |
micro-rotor,91 | |
MODELS,91 | |
mourlot,91 | |
Mouton-Rothschild--Vintage,91 | |
murrine,91 | |
Orig.,91 | |
outset,91 | |
own,91 | |
parts),91 | |
pigments.,91 | |
Porte,91 | |
Reproduction,91 | |
rootwood,91 | |
Rug" | |
",91 | |
scantily,91 | |
(see,91 | |
shutter,91 | |
signiert" | |
",91 | |
Signs,91 | |
soot,91 | |
spun,91 | |
story,91 | |
surmount.,91 | |
teapots,91 | |
Tin-glazed,91 | |
tote,91 | |
undertier" | |
",91 | |
Venice,91 | |
WALKER,91 | |
Waltham,91 | |
well-carved,91 | |
wheel.,91 | |
word,91 | |
18-ct,92 | |
2007" | |
",92 | |
2-handled,92 | |
4to.,92 | |
82,92 | |
advertisement,92 | |
'AP',92 | |
Barbaresco--Vintage,92 | |
black;,92 | |
bond,92 | |
Bradel,92 | |
bull" | |
",92 | |
cardstock,92 | |
Catherine,92 | |
century;,92 | |
chromolithographic,92 | |
cistern,92 | |
coats,92 | |
cover),92 | |
création,92 | |
dat.,92 | |
d?couvrant,92 | |
Dibond,92 | |
doublé,92 | |
Duke,92 | |
elaborados,92 | |
émergeant,92 | |
Empress,92 | |
fields,92 | |
florales,92 | |
fr,92 | |
FRAGMENT,92 | |
FRAME.,92 | |
geometrically,92 | |
glass,,92 | |
gravées,92 | |
griffin,92 | |
HOLDER,92 | |
item(s).,92 | |
Ivory" | |
",92 | |
kinetic,92 | |
knit,92 | |
LONGCASE,92 | |
Lord,92 | |
Mau:,92 | |
o'clock" | |
",92 | |
opener,92 | |
outfit,92 | |
PANELS,92 | |
patinated-metal,92 | |
Plate.,92 | |
pomegranates,92 | |
pulls,92 | |
race,92 | |
release,92 | |
resolution,92 | |
ridges,92 | |
scarab,92 | |
scarf" | |
",92 | |
shepherdess,92 | |
Side,92 | |
slate" | |
",92 | |
sombre,92 | |
sommé,92 | |
SOUP,92 | |
staffordshire,92 | |
Structure,92 | |
style;,92 | |
tails,92 | |
texture,92 | |
top-shoulder,92 | |
treen,92 | |
?vas?" | |
",92 | |
whose,92 | |
wreathed,92 | |
zwei,92 | |
1931" | |
",93 | |
5th,93 | |
97,93 | |
:A,93 | |
AC" | |
",93 | |
arrière,93 | |
bouquet" | |
",93 | |
bout,93 | |
BROOCHES,93 | |
BULGARI,93 | |
café,93 | |
Coast,93 | |
Coin,93 | |
commercial,93 | |
consoles,93 | |
control,93 | |
courtly,93 | |
crust,93 | |
Crystal" | |
",93 | |
cts,93 | |
d'Alep,93 | |
decorated.,93 | |
décorés,93 | |
described,93 | |
drypoints,93 | |
editeur" | |
",93 | |
egg" | |
",93 | |
escutcheons" | |
",93 | |
Figur:,93 | |
film" | |
",93 | |
fines,93 | |
fitting" | |
",93 | |
footstool,93 | |
(for,93 | |
fruit.,93 | |
fuji,93 | |
goldsmith,93 | |
gongs" | |
",93 | |
grasses,93 | |
Guarro,93 | |
hem,93 | |
hessian,93 | |
joan,93 | |
JOINED,93 | |
Jubilee,93 | |
key" | |
",93 | |
koro,93 | |
LANDSCAPE" | |
",93 | |
lanterns,93 | |
laser-cut,93 | |
(lastra)" | |
",93 | |
laurel" | |
",93 | |
Leslie,93 | |
LIFE,93 | |
light-blue,93 | |
lines.,93 | |
marking,93 | |
mid-19th,93 | |
millefiori,93 | |
movable,93 | |
NEAR,93 | |
orchid,93 | |
orchids,93 | |
Otto,93 | |
ovales,93 | |
page.,93 | |
photos.,93 | |
pi?tement,93 | |
pith,93 | |
plans,93 | |
plastique,93 | |
popular,93 | |
Provincial,93 | |
recently,93 | |
(relined).,93 | |
SALVER,93 | |
separately,93 | |
servers,93 | |
Service,93 | |
Sèvres,93 | |
silvered-metal,93 | |
simili-japan,93 | |
straight-grained,93 | |
strongly,93 | |
Teapot" | |
",93 | |
thin" | |
",93 | |
THREE-LIGHT,93 | |
touching,93 | |
tri-colour,93 | |
Wales,93 | |
Wang,93 | |
wash.,93 | |
WATCH" | |
",93 | |
wound,93 | |
Xuande,93 | |
xviiieme,93 | |
zipper,93 | |
1926" | |
",94 | |
1947" | |
",94 | |
22K,94 | |
according,94 | |
agrémentés,94 | |
Anglo,94 | |
bath,94 | |
blackwood,94 | |
cardinal,94 | |
charms" | |
",94 | |
clasps" | |
",94 | |
click,94 | |
Colours,94 | |
contoured,94 | |
cotton.,94 | |
cowhide,94 | |
c-print.,94 | |
crossbanding,94 | |
cuff" | |
",94 | |
d',94 | |
d'anses,94 | |
DECORATION,94 | |
deficient,94 | |
doublet,94 | |
edging" | |
",94 | |
fi,94 | |
flanges" | |
",94 | |
flow,94 | |
footring,94 | |
gallant,94 | |
Germany" | |
",94 | |
gravés,94 | |
greenish-white,94 | |
Ground,94 | |
head-,94 | |
hounds,94 | |
i" | |
",94 | |
�leo,94 | |
Inc." | |
",94 | |
Interior,94 | |
interlinear,94 | |
(late,94 | |
lava" | |
",94 | |
lavender-blue,94 | |
(le,94 | |
length" | |
",94 | |
length:,94 | |
lui,94 | |
marqueté,94 | |
mid-section,94 | |
model.,94 | |
ovolo,94 | |
pans" | |
",94 | |
PEARLS,94 | |
pipes,94 | |
postérieure,94 | |
Pot" | |
",94 | |
Princess,94 | |
saint-estéphe" | |
",94 | |
schauseite,94 | |
SOAPSTONE,94 | |
Spencer,94 | |
totalling,94 | |
underglaze-blue.,94 | |
uprights" | |
",94 | |
vergé,94 | |
verses" | |
",94 | |
verte" | |
",94 | |
11" | |
95 | |
""" | |
result = [] | |
for line in a.split('\n'): | |
line = line.strip('"') | |
if not len(line): | |
continue | |
if line[0] == ',': | |
if len(result): | |
result[-1][1] = line[1:] | |
else: | |
if ',' in line: | |
result.append(line.split(',')) | |
else: | |
result.append([line, 0]) | |
print(len(result)) | |
with open('result.html', 'w') as f: | |
f.write('<table>\n') | |
for x in result: | |
if x[1] > 0: | |
f.write('<tr><td>{}</td><td>{}</td></tr>\n'.format(x[0], x[1])) | |
f.write('</table>') | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment