Skip to content

Instantly share code, notes, and snippets.

View sathish-kumar-subramani's full-sized avatar

Sathish kumar Subramani sathish-kumar-subramani

View GitHub Profile
@sathish-kumar-subramani
sathish-kumar-subramani / split-csv.sh
Last active November 8, 2018 17:36
Split csv file into multiple csv files usind sed, retaining header
#!/bin/bash
fileName=$1
maxLines=$2
echo "File name: $fileName"
echo "Max Lines: $maxLines"
getGotalLinesCommand="cat $fileName | wc -l"
totalLines="$(eval $getGotalLinesCommand)"