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
"""" Basic Behavior | |
set number " show line numbers | |
set relativenumber " show relative line numbers | |
set wrap " wrap lines | |
set encoding=utf-8 " set encoding to UTF-8 (default was "latin1") | |
set lazyredraw " redraw screen only when we need to | |
set showmatch " highlight matching parentheses / brackets [{()}] | |
set laststatus=2 " always show statusline (even with only single window) | |
set ruler " show line and column number of the cursor on right side of statusline |
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
Name | Age | |
---|---|---|
Jesus | 2016 |
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
alias csvrowcount='for i in `find . -name "*.csv"`; do echo "$i"; csvstat --count $i; done' | |
alias csvfilecount='find . -name "*.csv" | wc -l' |
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
import csv | |
import string | |
def make_csv(): | |
with open('data.csv', 'wb') as fh: | |
writer = csv.writer(fh) | |
for i in range(10): | |
writer.writerow([i, string.lowercase[i:i+5]]) | |
def process_line(line): |
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
" Syntax highlighting | |
syntax on | |
filetype indent plugin on | |
" ghlight lines over 79 columns (PEP8) | |
highlight OverLength ctermbg=red ctermfg=white guibg=#351818 | |
match OverLength /\%79v.\+/ | |
" Convert tabs to 4 spaces | |
set tabstop=4 |
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
### Removes all rows that are identically '' | |
import parsekit | |
class FilterEmptyRows(parsekit.Step): | |
def run(self, record, metadata): | |
criterion = {'', None} | |
if not set(record).issubset(criterion): | |
return record, metadata |
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
from datetime import datetime | |
import parsekit | |
class FilterRows(parsekit.Step): | |
start_row = parsekit.Argument( | |
"The row to start emitting from.", | |
required=True, | |
type=int) |
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
import parsekit | |
class FilterEmptyRows(parsekit.Step): | |
def run(self, record, metadata): | |
criterion = {'', None} | |
if not set(record).issubset(criterion): | |
return record, metadata |
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
import parsekit | |
class FilterRow(parsekit.Step): | |
start_row = parsekit.Argument( | |
"The row to start emitting from.", | |
required=True, | |
type=int) | |
def configure(self, options): |
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
## Illinois: skip header rows | |
## Maine: skipped rows containing only '' or None | |
## Utah: skip empty rows, skip rows containing certain data in certain column. Specifically the footer row started with the date in first column, so it was filtered out by parsing first column as a date. | |
## Washington: removed rows that were identically '' from end of file |