Sponsored Content
Top Forums Shell Programming and Scripting Removing Headers and a Column Post 302162684 by DerangedNick on Tuesday 29th of January 2008 07:04:38 PM
Old 01-29-2008
I am currently looking at trying to use the script you provided. However my knowledge of running this against the file is rather slim since most of the commands I have run in the past do not call a script into it. If you wouldn't mind providing some more information on how to get this to run against the file i'd appreciate it. In the mean time I will continue messing with it to see if I can get anything. Thanks for the help. (Ignore above)


I seem to have gotten it to run ok, but i am getting these errors currently.


syntax error at testscript line 12, near "<>"
syntax error at testscript line 15, near "} else"
Execution of testscript aborted due to compilation errors.

Last edited by DerangedNick; 01-29-2008 at 08:10 PM.. Reason: Running
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Excel Column Headers

cat ABC.log | egrep "Error 500" >> /tmp/Logs.log egrep "<Mango>.*<.Mango>" Logs.log | sed -e "s/^.*<Mango/<Mango/" | cut -f2 -d">"| cut -f1 -d"<" >> /tmp/temp1.xls egrep "<Apple>.*<.Apple>" Logs.log | sed -e "s/^.*<Apple/<Apple/" | cut -f2 -d">"| cut -f1 -d"<" >> /tmp/temp2.xls print Heading1,... (1 Reply)
Discussion started by: pk_eee
1 Replies

2. 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

3. UNIX for Dummies Questions & Answers

Sort by Column Headers

Hi All, I am new to UNIX can you please help me to sort a file with different columns my file looks like this $ cat gaut.txt UID PID PPID PGID SID C STIME TTY TIME CMD liveuser 3008 2892 3008 3008 0 11:58 ? 00:00:00 gnome-session liveuser 3019 1 ... (8 Replies)
Discussion started by: cgk1983
8 Replies

4. Shell Programming and Scripting

Matching words based on column headers

Hi , Pls help on this. Input file: NAME1 BSC1 TEXT ID 1 MAINSFAIL TEXT ID 2 DGON TEXT ID 3 lOADONDG NAME2 BSC2 TEXT ID 1 DGON TEXT ID 3 lOADONG (1 Reply)
Discussion started by: bha148
1 Replies

5. Shell Programming and Scripting

Transpose field names from column headers to values in one column

Hi All, I'm looking for a script which can transpose field names from column headers to values in one column. for example, the input is: IDa;IDb;IDc;PARAM1;PARAM2;PARAM3; a;b;c;p1val;p2val;p3val; d;e;f;p4val;p5val;p6val; g;h;i;p7val;p8val;p9val; into the output like this: ... (6 Replies)
Discussion started by: popesk
6 Replies

6. Shell Programming and Scripting

Merge column headers and transpose

Hello Everyone! I am new on this forum and this is my first post. I wish to apologize for my, not canonical, English. I would like to solve this problem but I have no clue of how do it!I will be grateful if someone could help me! I have a table like this: gene TF1 TF2 TF3 TF4 gene1 1 2 3 4... (5 Replies)
Discussion started by: giuliangiuseppe
5 Replies

7. Shell Programming and Scripting

Sar -u generates multiple column headers in csv file

Hi All, The below sar -u command generates multiple column headers in csv file Expected output should print column headers only once in the csv file shell script: $cat sar_cpu_EBS.sh #!/bin/bash while ; do sar -u 15 1 | awk '/^/ {print $1,$2,$4,$6,$7}' | tr -s ' ' ',' >>... (6 Replies)
Discussion started by: a1_win
6 Replies

8. Shell Programming and Scripting

Merge csvs with column headers

hello gurus, Somebody must have done this before, I couldn't find anything. Please redirect me if this was solved before, and if not please help. To the problem now, I have multiple csv files (about 1000) which I need to concatenate by column header. The final file should have a superset... (4 Replies)
Discussion started by: abh.kumar
4 Replies

9. Shell Programming and Scripting

Capturing column headers in an array

Hello, I am processing a tab delimited text file and need to grab all of the column headers in an array. The input looks like, num Name PCA_A1 PCA_A2 PCA_A3 0 compound_00 -3.5054 -1.1207 -2.4372 1 compound_01 -2.2641 0.4287 ... (5 Replies)
Discussion started by: LMHmedchem
5 Replies

10. Shell Programming and Scripting

Row bind multiple csv files having different column headers

All, I guess by this time someone asked this kind of question, but sorry I am unable to find after a deep search. Here is my request I have many files out of which 2 sample files provided below. File-1 (with A,B as column headers) A,B 1,2 File-2 (with C, D as column headers) C,D 4,5 I... (7 Replies)
Discussion started by: ks_reddy
7 Replies
DBAMSG(1)						      General Commands Manual							 DBAMSG(1)

NAME
dbamsg - Work with encoded meteorological data SYNOPSIS
dbamsg [command] [options] [args...] DESCRIPTION
Examine, dump and convert files containing meteorological data. It supports observations encoded in BUFR, CREX and AOF formats. dbamsg always requires a non-switch argument, that indicates what is the operation that should be performed: help Print a help summary. help manpage Print this manpage. scan [options] [filter] filename [filename [...]] Summarise the contents of a file with meteorological data. dump [options] [filter] filename [filename [...]] Dump the contents of a file with meteorological data. cat [options] [filter] filename [filename [...]] Dump the raw data of a file with meteorological data. convert [options] [filter] filename [filename [...]] Convert meteorological data between different formats. compare [options] filename1 [filename2] Compare two files with meteorological data. fixaof [options] filename [filename1 [...]]] Recomputes the start and end of observation period in the headers of the given AOF files. makebufr [options] filename [filename1 [...]]] Read a simple description of a BUFR file and output the BUFR file.. Read a simple description of a BUFR file and output the BUFR file. This only works for simple BUFR messages without attributes encoded with data present bitmaps. bisect [options] --test=testscript filename Bisect filename and output the minimum subsequence found for which testscript fails.. Run testscript passing parts of filename on its stdin and checking the return code. Then divide the input in half and try on each half. Keep going until testscript does not fail in any portion of the file. Output to stdout the smallest portion for which testscript fails. This is useful to isolate the few messages in a file that cause problems. head [options] [filter] filename [filename [...]] Dump the contents of the header of a file with meteorological data. OPTIONS
dbamsg follows the usual GNU command line syntax, with long options starting with two dashes (`-'). Options used to filter messages --category=num match messages with the given data category --subcategory=num match BUFR messages with the given data subcategory --check-digit=num match CREX messages with check digit (if 1) or without check digit (if 0) --unparsable match only messages that cannot be parsed --parsable match only messages that can be parsed --index=expr match messages with the index in the given range (ex.: 1-5,9,22-30) Option for command scan -?, --help print an help message --verbose verbose output -t type, --type=type format of the input data ('bufr', 'crex', 'aof') Option for command dump -?, --help print an help message --verbose verbose output -t type, --type=type format of the unput data ('bufr', 'crex', 'aof') --interpreted dump the message as understood by the importer --precise import messages using precise contexts instead of standard ones --text dump as text that can be processed by dbamsg makebufr --csv dump in machine readable CSV format --dds dump structure of data description section --structured structured dump of the message contents Option for command cat -?, --help print an help message --verbose verbose output -t type, --type=type format of the input data ('bufr', 'crex', 'aof') Option for command convert -?, --help print an help message --verbose verbose output -t type, --type=type format of the input data ('bufr', 'crex', 'aof', 'csv') -d type, --dest=type format of the data in output ('bufr', 'crex', 'aof') --template=name template of the data in output (autoselect if not specified, 'list' gives a list) -r rep_memo, --report=rep_memo force output data to be of this type of report --precise import messages using precise contexts instead of standard ones --recompute-categories recompute data categories and subcategories according to message contents Option for command compare -?, --help print an help message --verbose verbose output -t type, --type1=type format of the first file to compare ('bufr', 'crex', 'aof') -d type, --type2=type format of the second file to compare ('bufr', 'crex', 'aof') Option for command fixaof -?, --help print an help message --verbose verbose output Option for command makebufr -?, --help print an help message --verbose verbose output Option for command bisect -?, --help print an help message --verbose verbose output --test=cmd command to run to test a message group -t type, --type=type format of the input data ('bufr', 'crex', 'aof') Option for command head -?, --help print an help message --verbose verbose output -t type, --type=type format of the input data ('bufr', 'crex', 'aof') EXAMPLES
Here are some example invocations of dbamsg: # Convert an AOF message to BUFR dbamsg convert file.aof > file.bufr # Convert a BUFR message to CREX dbamsg convert file.bufr -d crex > file.crex # Convert BUFR messages to CREX, but skip all those not in january 2010 dbamsg convert year=2010 month=1 file.bufr -d crex > file.crex # Dump the content of a message, as they are in the message dbamsg dump file.bufr # Dump the content of a message, interpreted as physical quantities dbamsg dump --interpreted file.bufr TEMPLATE NAMES
This is a list of possible template names for the --template switch: acars ACARS (autodetect) acars-ecmwf ACARS ECMWF (4.145) acars-wmo ACARS WMO airep AIREP (autodetect) airep-ecmwf AIREP ECMWF (4.142) amdar AMDAR (autodetect) amdar-ecmwf AMDAR ECMWF (4.144) amdar-wmo AMDAR WMO buoy Buoy (1.21) generic Generic (255.0) metar Metar (0.140) pilot Pilot (2.91) pollution Pollution (8.171) ship Synop ship (autodetect) ship-abbr Synop ship (abbreviated) (1.9) ship-auto Synop ship (auto) (1.13) ship-plain Synop ship (normal) (1.11) ship-reduced Synop ship (reduced) (1.19) synop Synop (autodetect) synop-ecmwf Synop ECMWF (autodetect) (0.1) synop-ecmwf-auto Synop ECMWF land auto (0.3) synop-ecmwf-land Synop ECMWF land (0.1) synop-ecmwf-land-high Synop ECMWF land high level station (0.1) synop-wmo Synop WMO (0.1) temp Temp (autodetect) temp-ecmwf Temp ECMWF (autodetect) temp-ecmwf-land Temp ECMWF land (2.101) temp-ecmwf-ship Temp ECMWF ship (2.102) temp-ship Temp ship (autodetect) temp-wmo Temp WMO (2.101) wmo WMO style templates (autodetect) --template=list will also print the list. AUTHOR
dbamsg has been written by Enrico Zini <enrico@enricozini.com> for ARPA Emilia Romagna, Servizio Idrometeorologico. may 16, 2012 DBAMSG(1)
All times are GMT -4. The time now is 03:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy