Extract info and find/count strings from blocks inside text file
Hello
I have a text file which has blocks like Code:
dir1/dir2/dir3/name_run_number1: What 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 fine Thanks |
Help us to help you. You gave a sample input file (that's good) and some words (also good). Construct a sample output file which corresponds to your sample input and post it here. With "Before and After" examples we can better understand your needs and also judge if our proposed solution fills those needs.
Daniel B. Martin |
Hi
So, I would like to get an output like "For number1 there are X entries in the corresponding block and partY is missing" or in case all "20" parts are in place something like "for number1 all ok" |
Quote:
Daniel B. Martin |
Well, if I had something more specific, then I could write the code my self wouldnt I ? I am new to all these, so if you can provide any code example would be great...
|
Quote:
Daniel B. Martin |
Quote:
Again, as danielbmartin asked, provide at least a sample of what you want the output to look like. Write it manually if need be, and you will also have to provide us what YOU have written/tried on your own, and tell us where you're stuck. There are thousands of very easily found bash scripting tutorials you can find with a brief Google search...there is one on my posting signature, and the ones on TLDP are excellent, and all have samples. http://www.tldp.org/ http://tldp.org/HOWTO/Bash-Prog-Intro-HOWTO.html EDIT: Sorry, you are not "new to all these". You have been here for FIVE YEARS now, and have asked similar questions several times in the past, such as these from years ago: http://www.linuxquestions.org/questi...ks-4175439457/ http://www.linuxquestions.org/questi...iteria-859135/ Show effort of your own, and don't ask people to do things for you. You will *NEVER* learn how to do anything if you keep asking others to do it for you. |
All times are GMT -5. The time now is 03:22 AM. |