Sponsored Content
Top Forums Shell Programming and Scripting Remove interspersed headers in .dat file with AWK Post 302546076 by gd9629 on Wednesday 10th of August 2011 10:30:24 AM
Old 08-10-2011
Using the same concept, I need to remove 6 lines of a data frame and those interspersed throughout.

Code:
10 May 2011 Created: 10 May 11 15:05 GMT Scale: SIO-2005 and others
GC-MD, Cape Grim, Tasmania, Lat.: 40.68S, Lon.: 144.69E, Alt: 94m above sea level
You can use the following format in Fortran to read data in different columns, (F10.5, 2I4,I6, 2I4,I6,1X,10(F10.3,a1))
    scale:  --  --    --  --  --    --     SIO-05     SIO-05     SIO-05     SIO-05     SIO-98     SIO-05 Tohoku-Uni     SIO-98    CSIRO94    CSIRO94
     unit:  --  --    --  --  --    --        ppt        ppt        ppt        ppt        ppb        ppt        ppb        ppt        ppb        ppb
      time  DD  MM  YYYY  hh min ABSDA     CFC-11     CFC-12    CH3CCl3       CCl4        N2O    CFC-113        CH4      CHCl3         CO         H2
2010.00004   1   1  2010   0  23 11628    239.925    533.582      8.181     86.203    322.195     75.690   1736.198      4.644     35.280    529.335 
2010.00012   1   1  2010   1   3 11628    239.436    533.013      8.224     86.178    321.900     75.496   1735.882      4.892     34.441    527.677 
2010.00020   1   1  2010   1  43 11628    239.884    533.140      7.948     85.851    322.215     75.451   1736.369      4.557     34.916    531.719 
2010.00027   1   1  2010   2  23 11628    239.977    533.657      8.383     86.410    322.339     75.445   1736.773      4.598     34.633    527.731 
2010.00035   1   1  2010   3   3 11628    239.687    533.042      8.032     86.418    322.198     75.405   1735.862      4.534     32.125    527.888 
2010.00042   1   1  2010   3  43 11628    239.733    533.058      7.837     86.113    322.212     75.436   1736.022      4.831     33.056    527.984

i.e. just remove all text bar the first 6 lines at the very top of the concatenated file
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

help:how to remove headers in output file

Hi I am running a script (which compares two directory contents) for which I am getting an output of 70 pages in which few pages are blank so I was able to delete those blank lines. But I also want to delete the headers present for each page. can any one help me by providing the code... (1 Reply)
Discussion started by: raj_thota
1 Replies

2. Shell Programming and Scripting

Remove Headers throughout a data file

I have a data file with over 500,000 records/lines that has the header throughout the file. SEQ_ID Name Start_Date Ins_date Add1 Add2 1 Harris 04/02/08 03/02/08 333 Main Suite 101 2 Smith 02/03/08 01/23/08 287 Jenkins SEQ_ID Name ... (3 Replies)
Discussion started by: psmall
3 Replies

3. Shell Programming and Scripting

Remove text between headers while leaving headers intact

Hi, I'm trying to strip all lines between two headers in a file: ### BEGIN ### Text to remove, contains all kinds of characters ... Antispyware-Downloadserver.com (Germany)=http://www.antispyware-downloadserver.c om/updates/ Antispyware-Downloadserver.com #2... (3 Replies)
Discussion started by: Trones
3 Replies

4. Shell Programming and Scripting

Merging of files with different headers to make combined headers file

Hi , I have a typical situation. I have 4 files and with different headers (number of headers is varible ). I need to make such a merged file which will have headers combined from all files (comman coluns should appear once only). For example - File 1 H1|H2|H3|H4 11|12|13|14 21|22|23|23... (1 Reply)
Discussion started by: marut_ashu
1 Replies

5. Shell Programming and Scripting

How to pull info under headers in file(awk,grep,while loop)

below is an extract from my file and I am trying to use Awk and grep and a while loop to pull infomation from under neath "HBA WWN=".HBA WWN=" reoccurs all over the file but the 100000c.....number are unique and I want to be able to pull and reference specifi information under this header ever time... (2 Replies)
Discussion started by: kieranfoley
2 Replies

6. Shell Programming and Scripting

Filter/remove duplicate .dat file with certain criteria

I am a beginner in Unix. Though have been asked to write a script to filter(remove duplicates) data from a .dat file. File is very huge containig billions of records. contents of file looks like 30002157,40342424,OTC,mart_rec,100, ,0 30002157,40343369,OTC,mart_rec,95, ,0... (6 Replies)
Discussion started by: mukeshguliao
6 Replies

7. Shell Programming and Scripting

How to remove duplicates from the .dat file

All, I have a file 1181CUSTOMER-L061411_003500.dat.Z having duplicate records in it. bash-2.05$ zcat 1181CUSTOMER-L061411_003500.dat.Z|grep "90876251S" 90876251S|ABG, AN ADAYANA COMPANY|3550 DEPAUW BLVD|||US|IN|INDIANAPOLIS||DAL|46268||||||GEN|||||||USD|||ABG, AN ADAYANA... (3 Replies)
Discussion started by: Oracle_User
3 Replies

8. UNIX for Dummies Questions & Answers

Using sed command to remove multiple instances of repeating headers in one file?

Hi, I have catenated multiple output files (from a monte carlo run) into one big output file. Each individual file has it's own two line header. So when I catenate, there are multiple two line headers (of the same wording) within the big file. How do I use the sed command to search for the... (1 Reply)
Discussion started by: rebazon
1 Replies

9. Shell Programming and Scripting

Remove <CR><LF> from the dat file in unix

Hi, The source system has created the file in the dat format and put into the linux directory as mentioned below. I want to do foloowing things. a) Delete the Line started with <CR><LF> in the record b)Also line ...........................................................<CR><LF> ... (1 Reply)
Discussion started by: mr_harish80
1 Replies

10. Shell Programming and Scripting

awk command on .DAT file not working?

Hi All, I am trying to run awk command on .DAT file and it is not working. The same command is working on .txt file: Contents of the file ZZ_55555555_444444_ZZZZZZ_7777777_888_99.DAT: HEADER|ZZ_55555555_444444_ZZZZZZ_7777777_888_99.DAT... (10 Replies)
Discussion started by: sagar.cumar
10 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 04:13 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy