LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

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


Hi,

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 04:43 AM.
 
Old 12-27-2008, 05:54 AM   #2
makuyl
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, 06:40 AM   #3
tucs_123
LQ Newbie
 
Registered: Dec 2008
Posts: 23

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

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


Reply



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

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:12 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration