I am new to unix shell scripting. My goal is to extract a set of strings present between the lines “——–” and store each set of strings to different files.
Eg:
My file main.txt looks like
----------------------------
One
two
three
----------------------------
abc
four
five
-----------------------------
Expected Output:
String appearing in between the lines “—-” has to be stored in different files like,
first.txt contains,
one
two
three
Second.txt contains,
abc
four
five
Request your valuable help in this.
Thanks in advance,
Srikanth
BTW, I use the shell only for interactive work. All coding gets done in Python.
You could use awk, too. But then you could use Python, Ruby, …. too.