diff --git a/splitfile2track.py b/splitfile2track.py new file mode 100644 index 0000000..2749837 --- /dev/null +++ b/splitfile2track.py @@ -0,0 +1,24 @@ +import sys + + +if len(sys.argv) != 2: + print 'Usage: %s file.dat' % sys.argv[0] + print 'Splits a 2K file.dat file into two 1K track files track0.dat and track1.dat' + sys.exit() + + + +infile = open(sys.argv[1], 'r') + +track0file = open("track0.dat", 'w') +track1file = open("track1.dat", 'w') + +t0dat = infile.read(1024) +t1dat = infile.read(1024) + + +track0file.write(t0dat) +track0file.close() + +track1file.write(t1dat) +track1file.close()