I got the contents between two strings in a variable which contains multiple lines.
I want to check whether each line starts with a number and if so I will increment a counter and also need string after that number and before the next number.
Say I have a variable $line which contains:

1. Create
    create a volume.
2. destroy 
      destroy a volume.


and so on.
I want to get the count say 10 operations in var1 , string after number in var2 and text after create,destroy (so on) in var3.
How to handle in shell script.
Thanks in advance

Adding Code :

line=$(sed -n '/Description/,/properties/p'    readme.txt)
echo "$line"



sed -n -e '/^[0-9]/{s/\([0-9]*\).*/\1/;h;n;s/^ *//;H;x;s/\n/ /p;d;}' &lt;&lt;&lt; "$line"
operations=0
while read -r n str ;
do
    let operations+=1
    printf '%d, %d, %s\n' "$operations" "$n" "$str"
done &lt; &lt;(sed -n -e '/^[0-9]/{s/\([0-9]*\).*/\1/;h;n;s/^ *//;H;x;s/\n/ /;p;d;}'  &lt;&lt;&lt;"$line")


printf "Opertions = %d\n' "$operations"
done


Where $line contains contents between Description and properties on which I have to do the required operations.


Question: Does every floor contain a secret room?
Answer: v1.48: Yes &amp; No. On rare occasions only the Top Secret/Hidden Room will be generated, due to the specific rules used for Secret Room placement. So there will always be a (Top) Secret/Hidden Room but not always a Secret Room, except on the first two levels Basement/Cellar where the map will be redrawn until there is a Secret Room.

I've had this twice personally when I had enough bombs (30-99) to bomb every wall. If you've found the TSR/HR, and the SR is not next to it and is not in any location that borders at least two rooms, you can stop there, as the Secret Room is never placed such that it borders only one room (only TSR/HR is). 

If you have a Moon card, using it in this situation will teleport you to a random room instead of the Secret Room. Also there are various items that reveal the location of the Secret Room when you possess or activate them, if there is no Secret Room then one won't be  revealed.