Hey Cluber, thanks for this code.
My knowledge of awk is null, basically.
I ran it and got to this:
I'm running this with Gawk for Windows (not at my laptop here).
Is that the reason why I'm getting this error?
If it is, I'll get a Linux VM running to test it out.
Thanks.
Moderator's Comments:
Use CODE tags for sample input and sample output; not just for code segments. Without the CODE tags, the spacing in the diagnostic messages from awk is lost.
Last edited by Don Cragun; 10-13-2013 at 12:08 AM..
Reason: Add CODE tags
Hi
I have a CSV file with me in this format
Currency, USD, EUR,
USD, 1.00, 1.32,
EUR, 0.66, 1.00,
How do I transpose the file to get to the format below.
currency, currency, rate
USD, USD, 1.00
USD, EUR, 1.32
EUR, USD, 0.66
EUR, EUR, 1.00
Thanks for your help
We are using... (2 Replies)
Folks,
I have a bit of an issue trying to obtain some data from a csv file using PERL. I can sort the file and remove any duplicates leaving only 4 or 5 rows containing data. My problem is that the data contained in the original file contains a lot more columns and when I try ro run this script... (13 Replies)
I need help to parse a file where there are many records, all of which are consistently separated by lines containing “^=============” and "^ End of Report".
Example:
=============
1
2
3
4
End of record
=============
1
3
4
End of record
Etc....
I only need specific lines... (5 Replies)
I have a file, not really a csv, but containing delineated data just the same. Lets call that file "raw_data.txt". It contains data in the format of company name:fein number like this:
first company name:123456789
second company name:987654321
what i need to do is read this file, apply... (11 Replies)
Hi,
It's been a few years since college when I did stuff like this all the time. Can someone help me figure out how to best tackle this problem? I need to parse a file full of entries that look like this:
<eq action="A" sectyType="0" symbol="PGR" exch="CA" curr="VEF" sess="NORM"... (7 Replies)
Hi,
Our requirement is to parse the input file(.csv format). The each column in the file is delimited with comma. We need to take each column and apply some business validation rule.
If data itself contains comma, then those fields are enclosed with double quotes ("). We can see this double... (7 Replies)
Hello Expert,
I have a file in the following format:
SYNTAX_VERSION 5
MONITOR "NAME_TEMPLATES"
DESCRIPTION "Monitors for contents of error "
INTERVAL "1m"
MONPROG "script.sh NAME_TEMPLATES"
MAXTHRESHOLD
GEN_BELOW_RESET
SEVERITY Major
... (17 Replies)
Hello !
I am very aware that this is not the first time this question is asked here, because I have already read a lot of previous answers, but none of them worked, so...
As said in the title, I want to read a csv file with a bash script.
Here is a sample of the file:
... (4 Replies)
This post is start for me ... I stumped at something that I not sure as to how start on ... I tried so of your script that i honestly lost mind looking and looking here ... please help
COL1 COl2 COL3
12222 AUH FLUEH
12222 SSC OPERA
12222 SSC ... (8 Replies)
My source file looks like this:
Cust-Number = "101"
Cust-Name="Joe"
Cust-Town="London"
Cust-hobby="tennis"
Cust-purchase="200"
Cust-Number = "102"
Cust-Name="Mary"
Cust-Town="Newyork"
Cust-hobby="reading"
Cust-purchase="125"
Now I want to parse this file (leaving out hobby) and... (10 Replies)
Discussion started by: Balav
10 Replies
LEARN ABOUT DEBIAN
mason
MASON(1)MASON(1)NAME
mason - interactively create a firewall
SYNOPSIS
mason < logfile > rulefile
DESCRIPTION
This manual page briefly documents the mason command.
mason interactively generates a set of firewall rules for a Linux-based firewall. This is done by turning on full IP logging, watching the
logs for connections, and generating rules describing the connections seen. mason is familiar with most of the quirks of various connec-
tion types (such as ftp and IRC), and can output rules for 2.0.x ipfwadm, 2.2.x ipchains, and Cisco packet filters.
mason operates by reading in log file information from standard input and writing firewall rules to standard output. This allows mason to
work offline or on a separate system. Real-time firewall generation can be achieved with a command like tail(1).
Most users will want to run mason with a user-friendly interface such as mason-gui-text(1).
ENVIRONMENT
mason is configured using the following environment variables.
ECHOCOMMAND
Sets the type of firewall rules that mason should output to standard out. Allowed values include "ipfwadm" and "ipchains". By
default, mason outputs whatever kind of rules are supported by the currently running Linux kernel.
DOCOMMAND
Sets the type of firewall rules that mason should run immediately when a rule is generated. Allowed values include "ipfwadm" and
"ipchains". By default, mason outputs whatever kind of rules are supported by the currently running Linux kernel.
HEARTBEAT
If set to "yes", mason will output a "+" or "-" to standard error whenever a rule generated by mason has been triggered.
DYNIP Set this to the list of interfaces that have dynamically assigned addresses, separated by spaces.
SEE ALSO mason-gui-text(1)AUTHOR
This manual page was written by Jeff Licquia <jeff@luci.org>, for the Debian GNU/Linux system (but may be used by others).
MASON(1)