Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 02-01-2008, 10:02 AM   #1
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.

Old 02-01-2008, 10:12 AM   #2
Senior Member
Registered: Aug 2006
Posts: 2,697
Blog Entries: 5

Rep: Reputation: 243Reputation: 243Reputation: 243
you can do it simply
egrep -v  "row|rows affected" osqloutputfile
Old 02-01-2008, 11:09 AM   #3
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.


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

All times are GMT -5. The time now is 03:26 AM.

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