I have a text file which has blocks likedir1/dir2/dir3/name_run_number1:line1_run_number1_part1line2_run_number1_part2line3_run_number1_part3...Each block is separated with a blank line and there is the : in the header of each one while each block has a unique number1 after run_ suffix which is also present in the lines inside the blockWhat I want to do is for each block, extract the number1 as shown in the first line and then for the lines below count from 1-20 and give a message if a partX line is missing. Any bash or python would be fineThanks
Extracting info from blocks inside text file
text processing