1. I am attempting to grab all lines beginning with 'results'
2. Put the results in a tab format to export to excel
3. Break up into major columns: IP address, Service, VulID number, (Security Note, hole, or Warning),
4. Sort the file by the field 7; only allow uniq finding; and for that finding putting all IP addresses associated with it into an array and sort for unique Ip addresses and print into it's own column ($3).
Example
However, I plan to print $3 at the end of the table. Sorry, I don't quite understand arrays.
This is what I have thus far.
Last edited by Scott; 10-25-2010 at 02:20 PM..
Reason: Code tags, please...
the -t ' ' part: ' ' is a tab character typed in from the keyboard, since it is whitespace you need ' ' around it.
The trailing 0}' suppresses default printing, some awks do that.
Jim, thanks for your help. Do you have any suggestions on how to merge all the relevant IPs to one finding in a cell of its own. I was told that an array could be used to do so. Ex:
192.168.2.1 general/udp 10287 For your information, here is the tra
192.168.2.2
192.168.2.3
192.168.2.1 general/udp 10290 For your information, here is the tra
192.168.2.2
192.168.2.5
I am developing one script which will take log file name, output file name, date, hour and minute as an argument and based on these inputs, the script will scan and capture all the error(s) that have been triggered from a given time. Example: script should capture all the error after 13:50 on Jan... (2 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)
Hi,
I need to parse input file from 2nd line.
Input file contents are,
ABC123;20100913115432;2000000;NO;
04;AAA;09;DDD;601020304;AAAA;1;OPTA1;OPTA2;;;
04;BBB;09;BBB;601020304;BBBB;0;OPTB1;OPTB2;OPTB3;OPTB4;OPTB5;
04;CCC;09;DDD;601020304;CCCC;1;;;;;
For each line,
1] I need to check... (17 Replies)
Hi Everybody,
I have an XML file containing some data and i want to extract it, but the specific issue in my file is that the data is repeated some times like the following example :
<section1>
<subsection1>
X=...
Y=...
Z=...
<\subsection1>
<subsection2>
X=...
Y=...
Z=...... (2 Replies)
Hi Guys,
I am new to unix scripting and I am tasked to parse through a CSV file delimited by #.
Sample:
sample.csv
H#A#B#C
D#A#B#C
T#A#B#C
H = Header
D = Detail Record
T = Tail
What I need is to read the file and parse through it to get the columns.
I have no idea on how... (8 Replies)
hi all,
i have a html file something similar to this.
<tr class="evenrow">
<td class="data">added</td><td class="data">xyz@abc.com</td>
<td class="data">filename.sql</td><td class="modifications-data">08/25/2009 07:58:40</td><td class="data">Added TK prof script</td>
</tr>
<tr... (1 Reply)
I am faced with a :confused: tricky problem to parse a data file ( May not be a tricky problem to the scripting guru's ).
Here is what I am faced with. I have a file with multiple rows of data and the rows are not of fixed length. "|" is used as a delimiters for individual columns and each row... (3 Replies)
Dear All,
I have a comma-separated file.
1. The first line of the file(header) should have 4 commas(5 fields).
2. The last line of the file should have 1 comma(2 fields).
Pls help me in checking this condition in a shell script.
And the number of lines between the first line and last... (11 Replies)
Hi! I'm just new here and don't know much about shell scripting. I just want to ask for help in creating a shell script that will parse a string or value of the status in the xml file. Please sample xml file below. Can you please help me create a simple script to get the value of status? Also it... (46 Replies)
How do i use a config.txt to recursively pass a set of variables to a shell script
eg my config.txt looks like this :
path=c://dataset/set1
v1= a.bin
v2= b.bin
path=c://dataset/set2
v1= xy.bin
v2= abc.bin
..................
and so on .
and my testscript : (2 Replies)