LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 10-04-2006, 12:16 PM   #1
analogdigit
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, 01:28 PM   #2
haertig
Senior Member
 
Registered: Nov 2004
Distribution: Debian, Ubuntu, LinuxMint, Slackware, SysrescueCD
Posts: 1,970

Rep: Reputation: 289Reputation: 289Reputation: 289
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"
"README"
"example queries"

If you want to cut right to the chase, go grab "sgrep-1.94a-doc.zip" from http://sourceforge.net/project/showf...ckage_id=16501

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, 04:17 PM   #3
analogdigit
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, 05:53 PM   #4
analogdigit
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:

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

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

Like This :

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

If somebody know please help me !!!!!
 
Old 10-29-2006, 06:03 AM   #5
claytonjohnroby
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, 06:44 AM   #6
homey
Senior Member
 
Registered: Oct 2003
Posts: 3,057

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


Reply

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


All times are GMT -5. The time now is 08:46 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration