LinuxQuestions.org
Review your favorite Linux distribution.
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 12-04-2009, 07:40 AM   #16
nushki
LQ Newbie
 
Registered: Mar 2009
Posts: 26

Original Poster
Rep: Reputation: 0

it a good idea to wtite in c++. I shoould have thought about it.

thank you very much!!!!!!!!!
 
Old 12-04-2009, 09:15 AM   #17
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,665
Blog Entries: 4

Rep: Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945Reputation: 3945
Generally speaking, for this task I would use either 'awk' or, better yet, Perl.

The task that you are seeking to do is an elementary one for regular expressions, which you see being used here in almost every one of the examples.

Remember this cardinal rule: "do not do a thing already done."

Your purpose should be to accomplish your task, as quickly and as simply (but also as accurately) as you possibly can, while expending the least amount of "unique effort" in the doing of it. So, "there is no reason to write a 'C' program to do this, even if you can." Likewise, IMHO, there's a contra-indication to writing a messy "sed"-based solution that you could not read and understand a week from now without learning it all over again.

No matter what you are doing, remember that thousands of people before you have been asked to do the same thing. They built, debugged, perfected, and then gave-away their tools to the entire community. So, in nearly every case, your modus operandi should not be "to hand craft a solution," but rather, "to find and use a solution that already exists."
 
  


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
line break on bash script ZAMO Linux - General 5 04-24-2010 12:27 PM
Grep words and paste is on the same line say_hi_ravi Programming 7 10-31-2008 06:56 AM
How do I extract characters from several words on a line? MheAd Linux - Newbie 22 06-23-2008 10:22 PM
CVS's line break management zWaR Programming 1 04-16-2007 09:00 PM
BASH: First words in a line JordanH Programming 7 10-24-2004 10:00 AM

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

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

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