I have a text file that looks like this:
[1] Header information Timestamp Text begins
Text continues
Text continues
Text continues
[2] Header information Timestamp Text begins
Text continues
Text continues
[3] Header information Timestamp Text begins
Text continues
Text continues
Text continues
I’d like to read that file in, and process each entry (they’re anywhere from 1 to 20 or 30 lines) individually.
Is there any way to loop through the file using the blank lines as a delimiter?
the answer is yes!
awk -vRS="" '...'will treat blank line as Row spliter.take your example and test: