Created
March 6, 2010 00:29
-
-
Save jfhbrook/323350 to your computer and use it in GitHub Desktop.
A quick lil' python script that uses gnumeric's ssconvert and the standard library's csv to, y'know, show me the contents of gnumeric files wif less.
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
#!/usr/bin/env python | |
from os import system | |
from re import sub | |
from sys import argv | |
from csv import reader, writer | |
def main(filename): | |
system('ssconvert -T Gnumeric_stf:stf_csv '+filename+' /tmp/ssconv1.csv') | |
read = reader(open('/tmp/ssconv1.csv','r'), 'excel') | |
write = writer(open('/tmp/ssconv2.csv','r+'), 'excel-tab') | |
for line in read: | |
write.writerow(line) | |
system('less /tmp/ssconv2.csv') | |
if __name__ == '__main__': | |
main(argv[1]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment