Need to remove a selection of rows separated by blank lines


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Need to remove a selection of rows separated by blank lines
# 1  
Old 12-06-2012
Need to remove a selection of rows separated by blank lines

hello, here is an example:

Code:
9.07
9.05
0.00
2.28
0.00
0.08
1.93
3.62
10.97

12.03
12.03
0.00
2.73
0.00
0.07
2.13
2.43
21.95

i wish to remove the first block of data, it is separated by blank lines above and below this. Please note that the data will constantly change with a new file so i am looking for a generic command not something that picks up specific numbers. I am relatively new to linux and i cant seem to figure out the exact command that needs to be used.
# 2  
Old 12-06-2012
It will print all the values after first blank line..Smilie
Code:
awk 'NR>1' RS= file

This User Gave Thanks to pamu For This Post:
# 3  
Old 12-06-2012
Thank you very much, it seemed to have worked. Testing it out now
# 4  
Old 12-06-2012
Code:
awk 'NF==0{a=1}a' input.txt

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Converting columns of text to rows, with blank lines

I've spent the past hour trying different things and googling for this solution and cannot find the answer. Found variations of this, but not this exact thing. I have the following text, which is the output from our mainframe. Each field is on a separate line, with a blank line between each... (7 Replies)
Discussion started by: lupin..the..3rd
7 Replies

2. Shell Programming and Scripting

Remove Blank lines in VI

Hi, Which option is used to remove blank lines in VI (AIX). ? Regards, Siva (6 Replies)
Discussion started by: ksgnathan
6 Replies

3. Shell Programming and Scripting

Perl : blank lines are displayed in the output after deleting few rows from excel

I am working on an assignment to pull all the records from excel sheet programatically and use the data for further calculations. In this process, I first defined 10 records in excel sheet and executed the below code. In the first run it is OK. But after deleting last few rows in excel sheet and... (0 Replies)
Discussion started by: giridhar276
0 Replies

4. Shell Programming and Scripting

Text file to CSV with field data separated by blank lines

Hello, I have some data in a text file where fields are separated by blank lines. There are only 6 fields however some fields have several lines of data as I will explain. Also data in a particular field is not consistently the same size but does end on a blank line. The first field start with... (6 Replies)
Discussion started by: vestport
6 Replies

5. UNIX and Linux Applications

remove all blank lines

When I 'vi' my test file I see some blank lines. However once I do :set list to display hidden characters, I see the empty lines literally like this: ^I$ How do I remove them? I cannot find a regex to match them. (3 Replies)
Discussion started by: alexsuv
3 Replies

6. Shell Programming and Scripting

How to remove blank lines

Hi, I am facing a problem related to removing blank lines from a text document. Input Error 17-05-2011 11:01:15 VisualSVN Server 2.1 1001 The following information was included with the event: line3 line4 Error 17-05-2011 11:00:25 VisualSVN Server 2.1 ... (13 Replies)
Discussion started by: mayursingru
13 Replies

7. Shell Programming and Scripting

remove blank lines and merge lines in shell

Hi, I'm not a expert in shell programming, so i've come here to take help from u gurus. I'm trying to tailor a csv file that i got to make it work for the LOAD FROM command. I've a datatable csv of the below format - --in file format xx,xx,xx ,xx , , , , ,,xx, xxxx,, ,, xxx,... (11 Replies)
Discussion started by: dvah
11 Replies

8. Shell Programming and Scripting

How to remove Blank rows in a csv file

Hi, I need help to remove blank rows at the end of file. Sample data: "Oslo, Symra kino",Oslo,130-7,Symra 1,130-7-91 "Tønsberg, Brygga Kino SF",Tønsberg,202-1,Tønsberg SF 4,202-1-4 ,,,, ,,,, ,,,, ,,,, Expected data: "Oslo, Symra kino",Oslo,130-7,Symra 1,130-7-91 "Tønsberg, Brygga... (6 Replies)
Discussion started by: cnraja
6 Replies

9. Shell Programming and Scripting

Remove Blank Rows

Hello All, I am having a problem in automating my UNIX Script to remove the blank spaces in between records. When I incorporate it into my script, the output file is deleting the whole content :confused: Basically this is what I am trying to do: File contains data like this:... (14 Replies)
Discussion started by: Vinsanity
14 Replies

10. Shell Programming and Scripting

Remove blank lines

I really hope someone can help me with this. I have several php files from a forum that I run, that now for some reason have blank lines after every line. Is there an easy way to make a script that does the following: * If there are consecutive blank lines, delete all of them except one. * If... (9 Replies)
Discussion started by: KidCactus
9 Replies
Login or Register to Ask a Question