Sponsored Content
Top Forums Shell Programming and Scripting Delete a section of a file if... Post 302637735 by zaxxon on Wednesday 9th of May 2012 08:31:58 AM
Old 05-09-2012
Code:
# awk '$1 == "2006" && $12 > 2 {i++} /^[ \t]*$/ {i--} i' infile
2006 0101 1236 49.3 L  37.902  48.482  0.0  Teh  5 0.2 2.7LTeh                1
 GAP=238                                                                       E
 Iranian Seismological Center, Institute of Geophysics, University of Tehran   6
 STAT SP IPHASW D HRMM SECON CODA AMPLIT PERI AZIMU VELO SNR AR TRES  W DIS CAZ7
 HSH  SZ E    0   1237 29.15      2843.4 0.04                           126 238
 AZR  SZ E    0   1237 58.33       598.9 0.14                           221 264
 MRD  SZ E    0   1238  5.28       615.6 0.22                           258 291
 BST  SZ E    0   1237 31.34       897.3 0.08                           143 261
 SHB  SZ E    0   1238  2.03       222.2 0.16                           254 279
 AZR  SE EPn  0   1236 40.89                                     0.0    0.0   0
 BST  SN EPn  0   1236 45.64                                     0.0    0.0   0
 HSH  SZ EPg  0   1237 9.75                                     -0.0    126 238
 BST  SZ EPn  4   1237 10.80                                    -3.6    143 261
 AZR  SZ EPn  0   1237 24.31                                     0.3    221 264
 SHB  SZ EPn  0   1237 27.99                                     0.0    254 279
 MRD  SZ EPn  0   1237 28.80                                     0.3    258 291
 BST  SN ELg  0   1237 29.38                                    -0.0    143 261
 AZR  SE ELg  0   1237 51.43                                     0.0    221 264

This User Gave Thanks to zaxxon For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

help find a section line of a file

hi, I have a 20 line file. I need a command which will brinf back a specific line based upon the line number I enter. e.g. the file looks like this and is called file1 jim is a man john is a woman james is a man wendy is a woman lesley is a woman i want a command that will... (4 Replies)
Discussion started by: sureshy
4 Replies

2. Shell Programming and Scripting

Using Sed to duplicate a section of a file....

hello all, I have a file like this: section 1 blah1 blah2 section 2 blah1 blah2 section 3 blah1 blah2 and I want to use sed to duplicate section 2, like this: section 1 blah1 blah2 section 2 blah1 blah2 section 2 blah1 (2 Replies)
Discussion started by: nick26
2 Replies

3. Shell Programming and Scripting

cutting a section of a big file

Hi, I have a text file 10giga size. Opening the file with vi takes forever ... Im intersting only with the 100 first records. Is there way to copy those 100 lines to new file (with no need to open the file)? Thanks (6 Replies)
Discussion started by: yoavbe
6 Replies

4. Shell Programming and Scripting

Extract section of file based on word in section

I have a list of Servers in no particular order as follows: virtualMachines="IIBSBS IIBVICDMS01 IIBVICMA01"And I am generating some output from a pre-existing script that gives me the following (this is a sample output selection). 9/17/2010 8:00:05 PM: Normal backup using VDRBACKUPS... (2 Replies)
Discussion started by: jelloir
2 Replies

5. Shell Programming and Scripting

Read section of file and take decision

Hi, My requirement is that I've to read a config file having below info Oracle number|double;integer -> user can put multiple values here blob|binary varchar2|string varchar|string number(p,s)|decimal timestamp|date/time and so on .... Sybase bigint|bigint datetime|date/time... (2 Replies)
Discussion started by: dips_ag
2 Replies

6. Shell Programming and Scripting

Fetch a section from a file

Hi, I have a file like... $cat file1 +++++++++++++++++++ client1 +++++++++++++++++++++++++++++ col1 col2 col3 ------ ----- ----- (0 rows affected) ========================================================= +++++++++++++++++++ client1 +++++++++++++++++++++++++++++ col1 col2 col3... (6 Replies)
Discussion started by: sam05121988
6 Replies

7. Shell Programming and Scripting

Extract record from file based on section.

input file output file (1 Reply)
Discussion started by: lathigara
1 Replies

8. Shell Programming and Scripting

awk to lookup section of file in a range of another file

In the below, I am trying to lookup $1 and $2 from file1, in a range search using $1 $2 $3 of file2. If the search key from file1 is found in file2, then the word low is printed in the last field of that line in the updated file1. Only the last section of file1 needs to be searched, but I am not... (6 Replies)
Discussion started by: cmccabe
6 Replies

9. Shell Programming and Scripting

How to segregate a section from big file?

Hello, I need to know all IP range (ip_prefix), associated with us-west-2 region only from this link - https://ip-ranges.amazonaws.com/ip-ranges.json (it can be opened in wordpad for better visibility) Please suggest, how would I do it. If vi, awk or sed is needed, I have downloaded it on my... (7 Replies)
Discussion started by: solaris_1977
7 Replies

10. Shell Programming and Scripting

How to change file section into each line?

Hi Gurus, I have below file which has different sections, need to move the sections to beginning of the each record. original file aaa bbb ccc ddd eee fff output file. aaa bbb ccc ddd eee fff (6 Replies)
Discussion started by: green_k
6 Replies
PPMIMGVQUANT(1) 					      General Commands Manual						   PPMIMGVQUANT(1)

NAME
ppmimgvquant - palette quantifier for Pilot Image Viewer pgm files, version 2.0. SYNOPSIS
ppmimgvquant [-4] [-h] [-v] [ppmquant options] DESCRIPTION
ppmimgvquant just calls ppmquant(1) with the following map file: P3 4 1 255 0 0 0 85 85 85 170 170 170 255 255 255 If you specify -4, then we use this map file: P3 16 1 255 0 0 0 17 17 17 34 34 34 51 51 51 68 68 68 85 85 85 102 102 102 119 119 119 136 136 136 153 153 153 170 170 170 187 187 187 204 204 204 221 221 221 238 238 238 255 255 255 The ppmquant(1) output is also passed through ppmtopgm(1) to ensure a graymap output file. OPTIONS
-4 Convert to 4 depth image (for Palm IIIx/V). -h Display a usage message and exit. -v Display the version number and exit. All other switches are passed to ppmquant(1). SEE ALSO
imgvinfo(1), imgvtopnm(1), imgvview(1), pbmtoimgv(1), pgmtoimgv(1), ppmquant(1), ppmtopgm(1), pbm(5), pgm(5). BUGS
Bug reports should be sent to Eric A. Howe (mu@trends.net). LICENSE
Copyright (C) 1997,1998 Eric A. Howe <http://www.trends.net/~mu>. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. Sept 1997 PPMIMGVQUANT(1)
All times are GMT -4. The time now is 04:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy