Bash how to split file on empty line with awk
问题 I have a text file ( A.in ) and I want to split it into multiple files. The split should occur everytime an empty line is found. The filenames should be progressive ( A1.in , A2.in , ..) I found this answer that suggests using awk , but I can't make it work with my desired naming convention awk -v RS="" '{print $0 > $1".txt"}' file I also found other answers telling me to use the command csplit -l but I can't make it match empty lines, I tried matching the pattern '' but I am not that