LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-01-2017, 07:54 AM   #16
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 10,005

Rep: Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191Reputation: 3191

Another alternative:
Code:
awk '!/01:AF:55:F6:B0:23/ && ORS=RT' RS="}" dhcpd.conf
 
Old 02-01-2017, 09:55 AM   #17
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,642
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
Well, the first thing that I would look for is some kind of an existing parser for this kind of information – someone who solved this problem and who posted their solution, say, on GitHub.

Otherwise, I probably would build a tool in a fully-equipped language such as Perl, and I might consider going so far as to use an actual parser such as Perl's Parse::RecDescent tool.
 
1 members found this post helpful.
Old 02-01-2017, 09:56 AM   #18
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,642
Blog Entries: 4

Rep: Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933Reputation: 3933
Well, the first thing that I would look for is some kind of an existing parser for this kind of information – someone who solved this problem and who posted their solution, say, on GitHub.

Otherwise, I probably would build a tool in a fully-equipped language such as Perl, and I might consider going so far as to use an actual parser such as Perl's Parse::RecDescent tool.

Note that this approach is "actual parsing," with a grammar for the specification language that you might encounter.
 
  


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
[SOLVED] Remove End of string from pattern Ra'Jiska Linux - Newbie 7 10-16-2015 06:29 AM
How to remove string in the text file ? Bash script dlugasx Linux - Server 9 06-05-2009 11:40 AM
Remove lines in a text file based on another text file asiandude Programming 10 01-29-2009 10:59 AM
Bash remove part of a file based on contents of another file bhepdogg Programming 4 01-31-2007 03:13 PM
Find string pattern in directory of text files magnum818 Linux - Newbie 2 10-15-2003 08:19 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:41 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