I want to select contents between two numbers say 1. and 2. from an output file which has many numbers but only the these two ending with a dot(.) eg 1. 2 . 32. etc I was looking to select with the use of a counter then modify the selected contents and put it in an output file where again the output file seems to overwrite. The external file contains many spaces and new lines in the contents. I am newbie in scripting. Sorry for the long post.
"freedom
hey begin Majnu
Market M.G.Street
Ghatkopar (W)
end
Mumbai 400086 India"
This would be the text in an external text file. I am looking to select every thing between 'begin' and 'end' then choose text based on match strings like street in this case and add into a filed named streets.
I have used
echo | sed -e '/begin/,/end/p' /path/to/file.text | more
to select text between begin and end
thisString=$inputline
searchString=" Street"
case $thisString in
*"$searchString"*) echo "Street found"
to find the letter Street.