I am trying to extract somne blocks from a text, however, it does not work now.
For example: I have a file named test01.txt with below contents:
10:10:12 :: blah blah blah
10:10:12 :: blah blah blah
10:10:14 :: $VAR1 = {
10:10:14 :: 'Id' = 'A0002'
10:10:15 :: 'Name' => 'Jane'
10:10:15 :: 'Age' => '18'
10:10:15 :: };
10:10:15 :: blah blah blah
10:10:16 :: blah blah blah
10:10:16 :: $VAR1 = {
10:10:16 :: 'Id' = 'A0003'
10:10:16 :: 'Name' => 'Adams'
10:10:16 :: 'Age' => '25'
10:10:16 :: };
expect results
{
10:10:14 :: 'Id' = 'A0002'
10:10:15 :: 'Name' => 'Jane'
10:10:15 :: 'Age' => '18'
10:10:15 :: }
{
10:10:16 :: 'Id' = 'A0003'
10:10:16 :: 'Name' => 'Adams'
10:10:16 :: 'Age' => '25'
10:10:16 :: }
I have used the following command "grep -e '{|}' test01.txt
", which does not solve this problem.
Any help would be really appreciated.