awk - pattern-directed scanning and processing language
1
vote
2answers
123 views
Unix command for pattern matching
I want to count the number of words and print the matched pattern lines which matches exactly with following pattern:
abc-ERROR:
The input File contains:
# abc-ERROR: xyxxkkfgfr
# def-Error: ...
0
votes
2answers
146 views
Select/extract columns based on the values on a certain row
Here is an example text file:
A B C D E F G
1 2 3 4 5 6 7
2 3 4 5 6 7 8
3 4 5 6 7 8 9
I would like to extract specific columns based on the values on the 3rd row, that is, 2 3 4 5 6 7 8.
Let's say, ...
1
vote
1answer
96 views
reading from a file and changing its pattern into an array?
I have a CSV file containging entries like this :
ipaddress,VLAN,VLANid
10.192.168.1,vlan-xyz,3
10.192.168.1,vlan-abc,8
10.192.168.1,vlan-mnp,11
10.192.163.24,vlan-llz,3
10.192.163.24,vlan-bbz,5
...
1
vote
1answer
62 views
Regex to Cisco Interface
I would like to know if have some sed, grep or awk regex to parse Cisco interface section and exclude if interface is down (shutdown), like example below.
Example:
!
interface FastEthernet0/1
ip ...
1
vote
1answer
208 views
Split log file by time range
I have a log file and would like to cut it into copies of 15min. In the log file the lines start with:
dd mmm yyyy hh:mm:ss,xxx
e.g.
12 Feb 2013 16:05:02,xxx log text...
and the file rotates ...
0
votes
1answer
71 views
Search low values in linux files
I am working with mainframe files and it seems that the low values (x'00') exists in the records in the file which throughs off my import for fixed block
Does anyone know how to eliminate this ...
1
vote
0answers
140 views
Processing shell script options with awk
I'm looking for way to process shell script arguments that is cleaner and more "self documenting" than getopt/getopts.
It would need to provide...
Full support of long options with or without a ...
1
vote
0answers
109 views
How to awk printf additional string with backslash
I have a csv that I want to add a preceding column to and a trailing column. The trailing column is a date (manual string right now). Every time I try to get that date, it ends up replacing some text ...
1
vote
0answers
130 views
Conky - string formatting
I have conky the record:
${color lightblue} Down: ${downspeed wlan0} Up: ${upspeed wlan0}
Conky prints link speed, but the text moves:
Down: OB Up: OB
Down: 60B Up: 60B
Down: 148B Up: 148B
...
0
votes
0answers
58 views
Co Record Verification
I have a task requiring some awk to verify a few records quickly.
Let' say:
A1,A2
B1,B2
C1,C2
C2,C1
A1,C1
A1,B1
B1,A1
Which would be the best way to check for reciprocity only between the A# the ...
