Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Software
User Name
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.


  Search this Thread
Old 10-04-2006, 01:16 PM   #1
LQ Newbie
Registered: Apr 2005
Posts: 7

Rep: Reputation: 0
PLEASE HELP ! Problem with SGREP command

Hello !
This is a first time I can't find some information on the net so I must write the question here!

I want to use sgrep command for some job, but I can't find some good tutorial on the net!

Only thing I found is a man page for that program!

Now, maybe I am a stupid but for me man page is not big help!

So I am asking is there some kind of tutorial or some more detail manual for this command !

Thnaks in advance !!!!
Old 10-04-2006, 02:28 PM   #2
Senior Member
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 2,072

Rep: Reputation: 323Reputation: 323Reputation: 323Reputation: 323
I've never used the program. But if you search for "sgrep" with Google, you find it's home page. On the home page scroll down a bit to where it says "How is sgrep used". The following links in that section look particularly useful:

"using sgrep for querying structured text files"
"sgrep manual page"
"example queries"

If you want to cut right to the chase, go grab "" from

All the above popped right up by typing "sgrep" into Google. Although I've never used this program, it certainly doesn't appear to be lacking documentation on the web.
Old 10-04-2006, 05:17 PM   #3
LQ Newbie
Registered: Apr 2005
Posts: 7

Original Poster
Rep: Reputation: 0
Heartig thanks for quick reply, but all of that docs I had seen and it is all just variations on the sam doc file ....
I need something like complete reference book or something ....
But thank You !!!!
Old 10-05-2006, 06:53 PM   #4
LQ Newbie
Registered: Apr 2005
Posts: 7

Original Poster
Rep: Reputation: 0
Maybe is there some other way for me to make what I want .

Does anybody know how can I do this:

I have one file with this structure:

IS 455,00
IS 455,00
IS 455,00

And I want to get a new one but in a other way :

Like This :

IS 455,00
IS 455,00
IS 455,00

If somebody know please help me !!!!!
Old 10-29-2006, 07:03 AM   #5
LQ Newbie
Registered: Oct 2006
Posts: 19

Rep: Reputation: 0
Open it in an editor that has a search and replace function and replace all instances of "IS 455,00" with "HD900000134314001427314001427200608\nIS 455,00" and then delete the first instance of HD900000134314001427314001427200608 which would be repeated.

You could also read up on sed to do the same thing.
Old 10-29-2006, 07:44 AM   #6
Senior Member
Registered: Oct 2003
Posts: 3,057

Rep: Reputation: 58
Maybe this will do...
sed -i.bak 's/IS 455,00/&\nHD900000134314001427314001427200608/' file.txt


command, manual

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
at Command Problem BBPS Linux - Software 2 09-06-2006 06:23 AM
problem with dd command ? MaaSTaaR Linux - General 5 06-25-2006 08:50 AM
problem in cp command ksriram03 Linux - Newbie 2 03-15-2006 12:12 PM
command problem vickr1z Linux - Newbie 3 09-06-2004 01:43 PM
problem with the configure command landshark753 Linux - General 6 01-31-2002 10:55 AM

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