I have a file which has some lines starting with a particular word. I would like to delete 5 lines before each such line containing that particular word.
eg:
line1
line2
line3
line4
line5
line6
"particular word"...
I would like to delete line2-line6 and all such occurences in that... (4 Replies)
Hello!
I need to delete one line in a file which matches one very precise instance of a string only. When searching the forum I unfortunately only found a solution which would delete each line on which a particular string occurs.
Let's assume I have a file composed of thousands of lines... (4 Replies)
I want to delete all lines from a file (orig_file) that contain the regex values (bad_inv_list)
I tried a for each loop with sed but it isn't working
for file in `cat bad_inv_list`;
do
sed '/$file/d' orig_file > pared_down_file.1
mv pared_down_file.1 orig_file
done
I've added... (2 Replies)
Hello,
I have a file filled with dates, such as:
04-08-2011 message
04-08-2011 message
03-08-2011 message
01-08-2011 message
31-07-2011 message
24-07-2011 message
15-07-2011 message
13-12-2008 message
26-11-2007 message
And I want to delete those lines whose date is older than 10... (5 Replies)
I have a big file having 100 K lines.
I have to read each line and see at 356 character position whethere there is a word "W" in it. If it is their then don't delete the line otherwise delete it.
There are two lines as one Header and one trailer which should remain same.
Can somebody... (5 Replies)
Hi,
I have a file with 20 columns of data and hundreds of lines of the same format.
Here is an example line. The data repeats underneath with the same format.
15 1 4 GLY - 1 65 LYSH 23 N - 24 H - 634 O 0.188 157.552 487 48.70I have been sorting this data by hand but I was wondering if I... (3 Replies)
Hi,
I'm trying to search for some number and from that line, i need to delete the 5th line exactly.
Eg:
Consider below as text file data:
10000
a
b
c
d
e
.
.
.
10000
w
q
t (8 Replies)