comparison query_tabular.py @ 9:0ed75ed20c7e draft

Fix skip lines
author jjohnson
date Thu, 02 Mar 2017 08:26:54 -0500
parents ae27dab228b8
children e84d1c3bf4fe
comparison
equal deleted inserted replaced
8:ae27dab228b8 9:0ed75ed20c7e
101 self.comment_char = comment_char 101 self.comment_char = comment_char
102 self.col_idx = col_idx 102 self.col_idx = col_idx
103 self.filters = filters 103 self.filters = filters
104 self.tsv_file = open(file_path) 104 self.tsv_file = open(file_path)
105 if skip and skip > 0: 105 if skip and skip > 0:
106 for i in range(5): 106 for i in range(skip):
107 if not self.tsv_file.readline(): 107 if not self.tsv_file.readline():
108 break 108 break
109 source = LineFilter(self.tsv_file,None) 109 source = LineFilter(self.tsv_file,None)
110 if comment_char: 110 if comment_char:
111 source = LineFilter(source,{"filter": "regex", "pattern": comment_char, "action": "exclude_match"}) 111 source = LineFilter(source,{"filter": "regex", "pattern": comment_char, "action": "exclude_match"})