Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/path/to/python -tt
- # numerical data
- # python GraphicalPart.py ../S001R03_data.txt_motor.txt_0.0_T0.txt
- import sys
- import matplotlib.pyplot as plt
- import numpy as np
- def startDivide(fileName):
- inputFile = open(fileName)
- outputFile = open(fileName + "_out.csv", "w")
- floatList = []
- for line in inputFile.readlines():
- data = line.split(" ")
- string = data[1] + "\n"
- if string.startswith('-')
- string = string[1:]
- outputFile.write("%s" % string)
- inputFile.close()
- outputFile.close()
- inputFileByTab = open(fileName + "_out.csv")
- data1=np.genfromtxt(fileName + '_out.csv', skip_header=1)
- #plt.plot(data1)
- #plt.show()
- def main():
- if len(sys.argv) != 2:
- print "Not enough arguments. *_data.txt file only!"
- else:
- startDivide(sys.argv[1])
- if __name__ == "__main__":
- main()
Advertisement
Add Comment
Please, Sign In to add comment