I have a file with alphabetically sorted lines. The file starts from 0-9 till a-z. Example
000dasd
001dss
awer
addd
alko
babb
bobb
...
zzasd
Since the file is really big I want to divide it into multiple files where in each file I will store different blocks - one file that will contain all lines starting with 0-9, one file containing [a-d], one file containing [e-h], and so on.
Currently, I have a grep command which does this but for just one char. Since I'm really new in Linux, grep, awk, and shell scripting I can use some help here.
That's how I do it for all lines that are starting with 'a'
grep "^[[:blank:]]*a" file.txt > a-file.txt