]> code.delx.au - dotfiles/blobdiff - bin/csv2txt
Convert tabs to spaces
[dotfiles] / bin / csv2txt
index 34adf32f7a7c8ac168c9990ae9238fbec317aa98..e9a7c37fdf0c8aaea419d30ab7b84f33aaaab4ee 100755 (executable)
@@ -6,7 +6,7 @@ import sys
 rows = list(csv.reader(sys.stdin))
 column_widths = list(max((len(str(cell))) for cell in column) for column in zip(*rows))
 for row in rows:
-       for width, cell in zip(column_widths, row):
-               print str(cell).ljust(width),
-       print
+    for width, cell in zip(column_widths, row):
+        print str(cell).ljust(width),
+    print