Skip to content

Instantly share code, notes, and snippets.

View liquidcarbon's full-sized avatar
🙃

Alexander Kislukhin liquidcarbon

🙃
  • Colorful Colorado
View GitHub Profile
@liquidcarbon
liquidcarbon / fix_linebreaks.py
Created June 29, 2020 23:11
Remove newline and caret return characters to fix broken lines in a large data export
import sys
def fix(file, sep, nf, output):
"""Checks and fixes prematurely terminated lines in a tabular file.
:param file: input file
:param sep: delimiter or its ASCII **octal** code
:param nf: expected number of fields
:param output: output file
:return: None