All Questions
7 questions
0
votes
1
answer
2k
views
How to compare two columns of two different files
I have two file.The first one contains something like:
a.com,5,some,text
b.com,10,some,text
c.com,5,some,text
d.com,12,some,text
e.com,5,some,text
c.com,5,some,text
The second contains something ...
0
votes
2
answers
2k
views
How to parse multi-line log file in awk and output only single line with last known ip address
I am stuck and looking for assistance. I want to trigger an event which I'd like to process further through a bash script. The data is retrieved from a log file. Before I start to explain I'll show ...
1
vote
3
answers
618
views
How to prefix the first 3 lines of a file with different variables?
So I have to go through a log I am emailed (in windows), search for a line to determine the models serial number, I figured an easy way to do that was to write up an ugly batch script to convert the ....
6
votes
1
answer
32k
views
awk - awk concatenate string variable
I would like to awk concatenate string variable in awk. How can I do that?
I tried:
BEGIN{
t="."
r=";"
w=t+r
print w}
But I does't work.
Output:
0
Or I want to add variable and result of function.
...
3
votes
4
answers
7k
views
Get LVM size using AWK?
I'm in need to find out the LVM size of image vm001. Let's say I have a LVM volume called /dev/VGgroup/vm001. Now using lvdisplay I can find out the size:
--- Logical volume ---
LV Name ...
6
votes
4
answers
21k
views
awk match whole word
I want to use awk to match whole words from text file. Including words bounded by non alphanumeric characters.
For example -
string to search for - ABC
Source file -
HHHABCCCCH
HHH ABC
HH(ABC)...
0
votes
1
answer
315
views
AWK CSV stream editing, merge third columns for identical first columns when second column >= 0
I'm on Windows and have only heard of linuxes awk etc so I can only imagine that this is possible without actual scripting:
I have data like
..
162 42 A single serving
162 62 of ...