mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
This commit is contained in:
13
scripts/strip_csv.py
Executable file
13
scripts/strip_csv.py
Executable file
@@ -0,0 +1,13 @@
|
||||
# strips out lines between two markers
|
||||
# pipe a file into, for example: 'cat x | python3 strip_csv.py'
|
||||
import fileinput
|
||||
with fileinput.input() as f_input:
|
||||
inRecordingMode = False
|
||||
for line in f_input:
|
||||
if not inRecordingMode:
|
||||
if line.startswith('---- CSV START ----'):
|
||||
inRecordingMode = True
|
||||
elif line.startswith('---- CSV END ----'):
|
||||
inRecordingMode = False
|
||||
else:
|
||||
print(line, end="")
|
||||
Reference in New Issue
Block a user