LinuxQuestions.org
Visit Jeremy's Blog.
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-2008, 09:02 AM   #1
elinenbe
LQ Newbie
 
Registered: Oct 2007
Posts: 23

Rep: Reputation: 15
Question help with sed / regexp


I'd like to forward the output of osql via email. I've gotten everything down except for one portion.

In the end of the osql output it gives a line like:

(1 row affected)
(2 rows affected)
(3 rows affected)
..
..
(999 rows affected)

...depending on the query given. I'd like to use sed to remove this line from the output, but I can't grasp how to do it. Any help would be appreciated.

Thanks,
Eric
 
Old 02-01-2008, 09:12 AM   #2
ghostdog74
Senior Member
 
Registered: Aug 2006
Posts: 2,695
Blog Entries: 5

Rep: Reputation: 240Reputation: 240Reputation: 240
you can do it simply
Code:
egrep -v  "row|rows affected" osqloutputfile
 
Old 02-01-2008, 10:09 AM   #3
elinenbe
LQ Newbie
 
Registered: Oct 2007
Posts: 23

Original Poster
Rep: Reputation: 15
Thanks that worked, though I'm using cygwin and had to do a dos2unix --d2u osqloutputfile first. Yeesh!

Thanks so much.
 
  


Reply


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
regexp help cliff76 Linux - Newbie 3 03-07-2008 02:15 PM
ls and regexp ygloo Programming 8 10-05-2006 03:50 PM
little help for regexp EmOuBi Linux - Newbie 6 08-06-2005 02:19 AM
regexp help ... pld Programming 1 03-15-2005 03:45 PM
Insert character into a line with sed? & variables in sed? jago25_98 Programming 5 03-11-2004 06:12 AM


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