07-07-2005
erasing blank lines using sed
do you also know how I can erase only the blank lines of a huge file?
I was thinking something similar to this, but this might also erase the blank spaces on lines with words?
sed "s|*[]*||g" huge_file;
thanks,
gammaman
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi,
I'm trying to use sed to erase everything, up to the first parenthesis. for example:
input: blah blah blah (aldj) test (dafs) test test.
output: (aldj) test (dafs) test test.
how would i do this?
I was fooling around with the parenthesis, and i only got it to apply on all parenthesis.... (1 Reply)
Discussion started by: gammaman
1 Replies
2. Shell Programming and Scripting
Hi all,
I am new to awk programs.I have a file like this
vjfavhjlaf<LTEXT>aabcdfffvvbbxbcddjbv</LTEXT>fAFdfdADfd
vjfavhjlaf<LTEXT>aabcdfffvvbbxbcddjbv</LTEXT>fAFdfdADfd
vjfavhjlaf<LTEXT>aabcdfffvvbbxbcddjbv</LTEXT>fAFdfdADfd
vjfavhjlaf<LTEXT>aabcdfffvvbbxbcddjbv</LTEXT>fAFdfdADfd... (3 Replies)
Discussion started by: anju
3 Replies
3. Shell Programming and Scripting
Hi all,
I am new to awk programs.I have a file like this
1234567@2345||adcbdefhij: asgdfdasdfhhfd-asdfasd-dsfasdf |0.678|0.0|0.213
1234567@2345||adcbdefhij: ashhfd-asdfasd-dsfasdf |0.129|0.0|0.411
1234567@2345||adcbdefhij: asd-aasd-dasdf |0.223|0.0|0.276
I want to delete the text which... (3 Replies)
Discussion started by: Loy81
3 Replies
4. Shell Programming and Scripting
Hi,
I am facing a little problem...
I have a line like this :
asdcvashfasashXXXXxxxzxcadd:sdcashjqdasdsmgdkdaxdsnd;
I want to print just a portion of line i.e starting from left 5 characters from ":" and upto ";" i.e. in this case it would be
"xcadd:sdcashjqdasdsmgdkdaxdsnd;"
The length of... (2 Replies)
Discussion started by: vanand420
2 Replies
5. Shell Programming and Scripting
Hi,
This is more a theoretical question, because I usually solved that with perl or even java, but I would like to know if it exists an easy way to do it with SED.
Using regular expresions it's very easy to select an portion line. Does it exist an easy way for printing those portions in SED?... (1 Reply)
Discussion started by: islegmar
1 Replies
6. Shell Programming and Scripting
Hi All
I have 3 files as listed below and highlighted in bold the portions of the filenames I need to extract:
TOS_TABIN218_20090323.200903231830
TOS_TABIN219_1_20090323.200903231830
TOS_TABIN219_2_20090323.200903231830
I tried
source_tabin_name=`echo $fname | sed 's/_.*//'`
but I... (6 Replies)
Discussion started by: santam
6 Replies
7. Shell Programming and Scripting
Hi All,
I posted something similar before but I now have a another problem.
I have filenames as below
TOP_TABIN240_20090323.200903231830
TOP_TABIN235_1_20090323.200903231830
i need to extract the dates as in bold. Using bash v 3.xx
Im trying to using the print sed command but... (11 Replies)
Discussion started by: santam
11 Replies
8. Shell Programming and Scripting
friends, i am a newbie in scripting. could someone help me in selecting only the last column of below ps command output ?
mqm 14 16466 0 Sep 15 ? 0:01 /opt/mqm/bin/runmqlsr -r -m QMGR.INBOUNDSSL -t TCP -p 1415 -i 5.1.26.5
mqm 12 16700 0 Sep 15 ? 0:00... (4 Replies)
Discussion started by: unahb1
4 Replies
9. Shell Programming and Scripting
Mysql log has something like:
I want to grep only the portion "ernie-1328697839.1233158" from each line. How to do this? (6 Replies)
Discussion started by: proactiveaditya
6 Replies
10. Shell Programming and Scripting
Thanks a lot for the code and the explanation.
Now my final requirement.
I have uploaded 3 files as attachment. Please open the files in Editplus or any other text editor which keeps the formatting.
GMDCOM.27936.log.txt------I want to pick only Process request from this file.(Please check... (9 Replies)
Discussion started by: ghosh_tanmoy
9 Replies
LEARN ABOUT OSF1
wclrtoeol
curs_clear(3) Library Functions Manual curs_clear(3)
NAME
curs_clear, clear, wclear, erase, werase, clrtobot, wclrtobot, clrtoeol, wclrtoeol - Clear all or part of a Curses window
SYNOPSIS
#include <curses.h>
int clear(
void ); int wclear(
WINDOW *win ); int erase(
void ); int werase(
WINDOW *win ); int clrtobot(
void ); int wclrtobot(
WINDOW *win ); int clrtoeol(
void ); int wclrtoeol(
WINDOW *win );
LIBRARY
Curses Library (libcurses)
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
clear, wclear, erase, werase, clrtobot, wclrtobot, clrtoeol, wclrtoeol: XCURSES4.2
Refer to the standards(5) reference page for more information about industry standards and associated tags.
DESCRIPTION
The erase and werase routines copy blanks to every position in the window.
The clear and wclear routines are similar to erase and werase but also call clearok. The result is that the screen is cleared completely on
the next call to wrefresh for that window and repainted from scratch.
The clrtobot and wclrtobot routines erase all lines below the cursor in the window. In addition, these routines erase the current line to
the right of the cursor, including the character on which the cursor is positioned.
The clrtoeol and wclrtoeol routines erase the current line to the right of the cursor, including the character on which the cursor is posi-
tioned.
NOTES
The header file <curses.h> automatically includes the header file <stdio.h>.
Note that erase, werase, clear, wclear, clrtobot, and clrtoeol may be macros.
RETURN VALUES
Upon successful completion, these routines return OK; otherwise, they return ERR.
SEE ALSO
Functions: curses(3), curs_outopts(3), curs_refresh(3)
Others: standards(5)
curs_clear(3)