Delete lines from a file where data is continously appended


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Delete lines from a file where data is continously appended
# 1  
Old 04-05-2010
Delete lines from a file where data is continously appended

Hello ,

Is there a way to delete lines from a file where data is continously appended to the file. I can use normal vi command ndd to remove n number of lines from the file, as the data is continously appended the line numbers doesnt work.
# 2  
Old 04-05-2010
What are you tring to acheive?

If you want to get rid of specific lines like for example: "Warning blah blah blah"

Code:
tail -f continous.log | grep -v '^Warning' > smaller.log

tail -f provides continuous output from a file like that.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Delete 40 lines after every 24 lines from a file

Hello, I have file of more than 10000 lines. I want to delete 40 lines after every 20 lines. e.g from a huge file, i want to delete line no from 34 - 74, then 94 - 134 etc and so on. Please let me know how i can do it. Best regards, (11 Replies)
Discussion started by: nehashine
11 Replies

2. UNIX for Dummies Questions & Answers

Mapping a data in a file and delete line in source file if data does not exist.

Hi Guys, Please help me with my problem here: I have a source file: 1212 23232 343434 ASAS1 4 3212 23232 343434 ASAS2 4 3234 23232 343434 QWQW1 4 1134 23232 343434 QWQW2 4 3212 23232 343434 QWQW3 4 and a mapping... (4 Replies)
Discussion started by: kokoro
4 Replies

3. Shell Programming and Scripting

awk print re-direction to a file with timestamp appended

Hello I need to split big xml file into multiple files based on xml declaration. for that i have written one awk 1 liner as below awk '/<?xml\ version/{i++}{print > "outfile."i}' test123.xml this is producing the desired out put. but i want the the currenttimestamp with milliseconds in the... (3 Replies)
Discussion started by: dsdev_123
3 Replies

4. Shell Programming and Scripting

Redirecting stdout continously to a file

I have a C program that continously outputs info to stdout. The problem is that I am redirecting the stdout and stderr to a file and stdout is written at the end of the problem rather than continously to the file. This could be a problem if for example the program is killed and the stdout output is... (3 Replies)
Discussion started by: igurov
3 Replies

5. UNIX for Advanced & Expert Users

In a huge file, Delete duplicate lines leaving unique lines

Hi All, I have a very huge file (4GB) which has duplicate lines. I want to delete duplicate lines leaving unique lines. Sort, uniq, awk '!x++' are not working as its running out of buffer space. I dont know if this works : I want to read each line of the File in a For Loop, and want to... (16 Replies)
Discussion started by: krishnix
16 Replies

6. Shell Programming and Scripting

Extracting specific lines of data from a file and related lines of data based on a grep value range?

Hi, I have one file, say file 1, that has data like below where 19900107 is the date, 19900107 12 144 129 0.7380047 19900108 12 168 129 0.3149017 19900109 12 192 129 3.2766666E-02 ... (3 Replies)
Discussion started by: Wynner
3 Replies

7. Shell Programming and Scripting

Delete lines line by match data 2 file.

i need to delete the lines is match from file data 1 & data 2 please help? data 1 4825307 4825308 4825248 4825309 4825310 4825311 4825336 data 2 4825248 0100362210 Time4Meal 39.00 41.73 MO & MT MT SMS 4825305 0100367565... (2 Replies)
Discussion started by: ooilinlove
2 Replies

8. UNIX for Dummies Questions & Answers

How get only required lines & delete the rest of the lines in file

Hiiii I have a file which contains huge data as a.dat: PDE 1990 1 9 18 51 28.90 24.7500 95.2800 118.0 6.1 0.0 BURMA event name: 010990D time shift: 7.3000 half duration: 5.0000 latitude: 24.4200 longitude: 94.9500 depth: 129.6000 Mrr: ... (7 Replies)
Discussion started by: reva
7 Replies

9. Shell Programming and Scripting

How to delete lines in a file that have duplicates or derive the lines that aper once

Input: a b b c d d I need: a c I know how to get this (the lines that have duplicates) : b d sort file | uniq -d But i need opossite of this. I have searched the forum and other places as well, but have found solution for everything except this variant of the problem. (3 Replies)
Discussion started by: necroman08
3 Replies

10. Shell Programming and Scripting

Polling continously for presence of a file

Hi, My os is sun solaris 5.10 and Korn shell scripting. I have a file name like CCNA_EARLY_SWP.w062309 where 062309 is date in mmddyy .This is the value date of the file.(will I need to check continously from 5.00 - 7.00 am daily for this file . If the file has not come at 5 am or 7am... (4 Replies)
Discussion started by: manoj39
4 Replies
Login or Register to Ask a Question