File: replace_gz.py

package info (click to toggle)
gnuplot5 5.0.0~rc%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 11,548 kB
  • ctags: 8,104
  • sloc: ansic: 77,108; cpp: 6,848; makefile: 1,932; sh: 1,343; lisp: 657; perl: 302; awk: 235; pascal: 194; 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)