LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-04-2011, 07:25 AM   #1
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
scan text for patterns


Ages ago I remember using some dos program that would scan text files for particular words/patterns. It had an ncurses-like interface and if I'm not wrong its name was "Concord". Is there anything like that on linux? The main functionality was as follows:
1. support for regular expressions
2. print lines containing a particular word or pattern (highlighting it) and printing the surrounding lines.
3. print lines containing a particular word or pattern only if another pattern occurs within N words to the left/right.


The second point is easy to achieve in grep. The 3rd one could be done in awk.
The problem is that as much fun as it would be to put it all together and embellish with some nice ncurses interface(eg. with dialog), I don't want to reinvent the wheel. Besides, I have just relocated and have been waiting for my phone line welcome pack for almost 2 weeks now (ie. no internet apart from work and mobile phone), which makes it difficult for me to get anything done.

Does anyone know of some program/script that could perform those functions?

thanks
 
Old 04-04-2011, 09:52 AM   #2
Snark1994
Senior Member
 
Registered: Sep 2010
Distribution: Debian
Posts: 1,632
Blog Entries: 3

Rep: Reputation: 346Reputation: 346Reputation: 346Reputation: 346
There are various programmes which sound similar on http://www.textanalysis.info/inforet.htm (I googled "linux text concordance software"). It's not made obvious whether they're GUI or text-based (certainly, all the ones I clicked on were GUI-based) but there might be one I missed, or useful search terms... Sorry I couldn't be of more help
 
1 members found this post helpful.
Old 04-04-2011, 10:03 AM   #3
sycamorex
LQ Veteran
 
Registered: Nov 2005
Location: London
Distribution: Slackware64-current
Posts: 5,836

Original Poster
Blog Entries: 1

Rep: Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251Reputation: 1251
Thanks. The link looks promising. I'll check it.
 
  


Reply



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
Modify the only one pattern among two patterns in a text file linuxromeo Linux - Newbie 3 11-22-2010 03:43 AM
Scan and Save As a Text file mickeyboa Fedora 6 09-30-2010 03:58 PM
search / count unique patterns in text file logicalfuzz Linux - Newbie 2 10-14-2006 07:58 AM
Deleting text between two different patterns activeco Linux - General 7 09-13-2005 06:05 PM
Remembering patterns and printing only those patterns using sed bernie82 Programming 5 05-26-2005 05:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:02 AM.

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