File: replace_gz.py

package info (click to toggle)
gnuplot 6.0.3%2Bdfsg1-1~exp2
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 14,960 kB
  • sloc: ansic: 95,874; cpp: 7,199; makefile: 2,470; javascript: 2,339; sh: 1,531; lisp: 664; perl: 304; pascal: 191; tcl: 88; python: 46
file content (55 lines) | stat: -rwxr-xr-x 948 bytes parent folder | download | duplicates (14)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#!/usr/bin/env python
# encoding: utf-8
#


import os, numpy, math, sys, datetime, glob

list_of_files = glob.glob('./files/*')


files = [
'airfoil.dem.gz',
'blutux.rgb.gz',
'contours.dem.gz',
'delaunay-edges.dat.gz',
'demo.edf.gz',
'equipo2.tmp.gz',
'field2xy.tmp.gz',
'finance.dat.gz',
'finance.dem.gz',
'fit3.dat.gz',
'fit.dem.gz',
'fit.log.gz',
'glass.dat.gz',
'GM1_bonds.r3d.gz',
'GM1_sugar.pdb.gz',
'gpdemos.tcl.gz',
'hemisphr.dat.gz',
'image2.dem.gz',
'image.dem.gz',
'key.dem.gz',
'klein.dat.gz',
'lena.rgb.gz',
'moli3.dat.gz',
'nearmap.csv.gz',
'orbital_elements.dat.gz',
'pm3dcolors.dem.gz',
'pm3d.dem.gz',
'poldat.dem.gz',
'prob2.dem.gz',
'prob.dem.gz',
'random.dem.gz',
'random-points.gz',
'random.tmp.gz',
'stat.inc.gz',
'surface1.dem.gz',
'using.dat.gz',
'whale.dat.gz',
'world.dat.gz']

for i in list_of_files:
  if (i[-3:]<>'.gz'):
    for z in files:
      s = 'sed -i \'s/%s/<zcat %s/g\' %s' % (z[:-3], z, i)
      os.system(s)