I need to delete every empty line in a file. Also, I need to delete the first 10 lines and the last 5 lines in that files regardless if they are empty or not.
#! /bin/ksh -x
# Get the number of lines in the file
FILE=data
typeset -i LINES=`cat $FILE | wc -l`
FIVELESS=`expr $LINES - 5`
sed -e "$FIVELESS,${LINES}d" -e '1,10d' -e '/^$/d' data
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.