I have a large file, about 10GB. I have a vector of line numbers which I would like to use to split the file. Ideally I would like to accomplish this using command-line utilitie
Here is a little awk that does the trick for you:
awk
awk -v v="2 5" 'BEGIN{v=" 1 "v" "} index(v," "FNR" ") { close(f); f=FILENAME "." (++i) } { print > f }' file
This will create files of the form: file.1, file.2, file.3, ...
file.1
file.2
file.3