-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
using python for removal of empty lines because it did not work
- Loading branch information
1 parent
c13aed6
commit 5d81f7a
Showing
2 changed files
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"description": "Remove lines that are empty or just whitespace on either side", | ||
"type": "bilingual", | ||
"command": "grep -avE $'^\\\\s*\\t|\\t\\\\s*$|^[^\\t]*$'", | ||
"command": "./remove_empty_lines.py", | ||
"parameters": {} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env python3 | ||
import sys | ||
|
||
def main(): | ||
for line in sys.stdin: | ||
fields = line.strip("\r\n").split("\t") | ||
ok = True | ||
for field in fields: | ||
if not field.strip(): | ||
ok = False | ||
break | ||
if ok: | ||
sys.stdout.write(line) | ||
|
||
if __name__ == '__main__': | ||
main() |