I am trying to split a large file based on a template. For this I use the awk command. After creating a certain number of files, it gives an error: too many open files.
Command:
awk '/pattern here/{i++}{print > "file"i}' /input file
Can someone tell me how to close these files? I tried to follow, but it gives an error.
awk '/pattern here/{i++}{print > "file"i}' /input file | close("file"i)
Thanks.
source share