Skip to content

Instantly share code, notes, and snippets.

@mzsm
Created November 29, 2013 08:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mzsm/7702773 to your computer and use it in GitHub Desktop.
Save mzsm/7702773 to your computer and use it in GitHub Desktop.
CSVを、PythonのCSVリーダが想定通りにパースしてくれるか確認するツール。 確認したいCSVファイルを引数に渡して起動する
# -*- coding: utf-8 -*-
import csv
import sys
def main(filepath):
csvfile = open(filepath)
for num, line in enumerate(csv.reader(csvfile)):
print("line {0}: ({1} fields) {2} ".format(num, len(line), line))
if __name__ == '__main__':
main(sys.argv[1])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment