Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-24-2015, 12:03 PM   #1
Registered: Mar 2010
Posts: 47

Rep: Reputation: 0
Extract info and find/count strings from blocks inside text file


I have a text file which has blocks like
Each block is separated with a blank line and there is the ":" in the "header" of each one while each block carries the same "number1" after "run_" suffix
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


Last edited by Alkass; 01-24-2015 at 12:13 PM.
Old 01-24-2015, 12:16 PM   #2
Registered: Mar 2010
Posts: 47

Original Poster
Rep: Reputation: 0
Please ignore this thread - I ve moved it to "Programming" session


bash, python

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Shell command/script to find duplicate strings in a text file damgar General 4 09-04-2012 02:17 PM
[SOLVED] Need help!!How to extract text in one file as variable then count it in another file? nobtiba Programming 14 01-04-2011 02:37 AM
How to extract text blocks seperated by blank line art84_LV Programming 9 11-17-2009 02:02 AM
Extract certain text info from text file xmrkite Linux - Software 30 02-26-2008 12:06 PM
script to extract blocks of text from many files. gruessle Programming 4 10-19-2007 03:31 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:04 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration