Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 12-27-2008, 05:39 AM   #1
LQ Newbie
Registered: Dec 2008
Posts: 23

Rep: Reputation: 15
remove the dashed lines present in the file


The content of my text file is as below.How can I remove the dashed lines present in the file.The below content is the result of a queries executed in the sybase.
set nocount on in sybase just removes the rows affected.

The "isql -b" option to remove header and dashed lines works fine when executed from prompt,but not from the script,when I connect to sybase through script.

more test.txt.

Dec 22 2008 8:30PM

Dec 22 2008 8:55PM

Dec 23 2008 12:00AM

Dec 23 2008 1:44AM

Dec 23 2008 1:44AM

Thanks in advance......

Last edited by tucs_123; 12-27-2008 at 05:43 AM.
Old 12-27-2008, 06:54 AM   #2
Senior Member
Registered: Dec 2004
Location: Helsinki
Distribution: Debian Sid
Posts: 1,107

Rep: Reputation: 54
sed -i '/---/d' test.txt
Do a dry run first without the -i.
Btw, I put three dashes there just out of a whim.
Old 12-27-2008, 07:40 AM   #3
LQ Newbie
Registered: Dec 2008
Posts: 23

Original Poster
Rep: Reputation: 15
Hey thanks works without -i option.....

Last edited by tucs_123; 12-27-2008 at 08:13 AM.


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
How to remove first 2 lines of a file in a script nazs Programming 16 02-19-2007 08:08 AM
How to remove lines from a file doza Linux - General 2 04-27-2005 12:59 PM
remove identical lines in a file benjithegreat98 Linux - General 4 04-24-2004 07:12 AM
How do i remove blank lines from a file? kakho Programming 1 04-15-2004 04:57 AM
[bash] remove lines from a file Drimo Programming 3 03-20-2004 12:16 PM > Forums > Linux Forums > Linux - Newbie

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