Merge branch 'master' of git.esilibrary.com:migration-tools while adding mig reporter...
[migration-tools.git] / text / split_body_from_headers
1 #!/bin/bash
2 START=$2
3 if [ ! $START ]; then
4     START=1;
5 fi
6 tail -n +$START $1 | head -1 > $1.headers
7 echo "wrote $1.headers (line $START)"
8 tail -n +`expr $START + 1` $1 > $1.no_headers
9 echo "wrote $1.no_headers (after line $START)"
10 if [ "$START" -gt "1" ]; then
11     tail -n +$START $1 > $1.with_headers
12     echo "wrote $1.with_headers (starting with line $START)"
13 fi