What I'm trying to do is delete every blank line upto a certain number, so for instance I only want to delete the first 4 empty lines within a file, I know how to delete every line with:
But I can't figure out how to limit it to only the first 4 occourances
Hi,
I need to delete the lines with empty name.
What is the best way to do it?
Thanks a lot for your help!
EMID MMDDYY HOURS JOB EMNAME
0241 051605 11.40 52062 someone
0520 051605 10.63 52062
0520 051605 10.66 52062
0520 051605 10.65 52062 (3 Replies)
abc#
abc#this is a test
abc#this is a test to delete
abc#
xyz#
xyz#this is a test two
xyz#
In the above example '#' is common. How to do delete the emply lines. In specific to observe the output as:
abc#this is a test
abc#this is a test to delete
xyz#this is a test two
.
.
.
. (5 Replies)
Hello !
I am trying to delete a number from the even-numbered lines of a pipeline after having extracted and sorted the desired data from an original text file using sed...
sed -r 's/\(*\)*\((*)\),*,*,(*)*: * \w*\=(*).*/\3,\1/g' | sort -n
then the data looks like :
Now, I am... (3 Replies)
I was just looking at this post: https://www.unix.com/shell-programming-scripting/22893-delete-multiple-empty-lines.html.
and I am looking to achieve the same with sed. So the idea is to delete lines from a file where a certain field has no value.
Inputfile:
EMID MMDDYY HOURS JOB EMNAME
0241... (4 Replies)
First of all, I know this can be more eassily done with perl or other scripting languages but, that's not the issue. I need this in sed. (or wander if it's possible )
I got a file (trace file to recreate the control file from oracle for the dba boys)
which contains
some lines
another line... (11 Replies)
I have a file with ~200K lines, I need to delete 4K lines in it. There is no range.
I do have the line numbers of the lines which I want to be deleted.
I did tried using
> cat del.lines
sed '510d;12d;219d;......;3999d' file
> source del.lines
Word too long.
I even tried... (2 Replies)
hi,
I'd like to ask you if you can help me with such surely easy thing - I have some data and need to plot them. I have txt of data in two columns, tab separated, but some second columns are empty. like
1```` 2
1.2``
3```` 2
4.44`
5`````
6.1```1
how can I erase all the lines... (2 Replies)
Hello,
I'm trying to figure out how to use sed or awk to delete single lines in a file. By single, I mean lines that are not touching any other lines (just one line with white space above and below).
Example:
one
two
three
four
five
six
seven
eight
I want it to look like: (6 Replies)