File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 11#!/usr/bin/env python
2+ # -*- coding: utf-8 -*-
23import argparse
34import sys
45import re
@@ -67,15 +68,15 @@ def main():
6768 tqdm .write ("Found {} files to search. Please wait." .
6869 format (len (all_txt_files )))
6970
70- with open (csv_file_name , 'a+' , encoding = "utf-8" ) as f :
71+ with open (csv_file_name , 'a+' , encoding = "utf-8-sig " ) as f :
7172 # Using dictionary keys as fieldnames for the CSV file header
7273 writer = csv .DictWriter (f , headers )
7374 writer .writeheader ()
7475 logger .info ("CSV headers written" )
7576
7677 for idx , txt_file in enumerate (all_txt_files ):
7778
78- with open (txt_file ) as fp :
79+ with open (txt_file , "r" , encoding = "utf-8-sig" ) as fp :
7980 visible_text_list = fp .readlines ()
8081 current_url = visible_text_list [0 ].strip ().rstrip ()
8182 num_digits = len (str (len (all_txt_files )))
You can’t perform that action at this time.
0 commit comments