Skip to content
Advertisement

Tag: awk

How to replace newlines between brackets

I have log file similar to this format Here is the echo command to produce that output $ echo -e “test {nseq-cont {nttt0,nttt67,nttt266nttt},nttgrp-id 505nt}n}ntest{nttest1{nttvalnt}n}n” Question is how to remove all whitespace between seq-cont { and the next } that may be multiple in the file. I want the output to be like this. Preferably use sed to produce the output.

print specific field from specific line of csv file linux

I am trying to extract a specific field in a specific line of a CSV file. I’m able to do it according to the number row but sometimes the row number of the file will change so this is not that flexible. I wanted to try and do it to extract a specific name before the field I’m interested in.

Combine multiple files csv into one using awk

I want to combine two .csv files based on the unique id that exists in both files. First file consist of 17 columns and the second one in 2 columns where in both files the first column is the same unique id. In the to be created file 3 i would like 18 columns. I have been trying paste paste

Trying to use awk to parse lscpu output but can’t get it right

Essentially what I want is to extract the byte size of the L3 cache from lscpu. The tricky part is that the units lscpu uses is not consistent across versions and what I need has to work with all versions (including the versions before the –bytes option was available). lscpu from what I can see will either use K, KiB,

Using awk in a bash-script

I’ve been struggling to run an awk result as the arguments of a new awk command within a bash-script; something like this To help eradicate (what I think is) inconsequential code to this problem, gives me and if prepend awk to this result, I get the answer I need. But I’m not able to make it work with xargs; it

Writing a script with ping information into an excel or .csv file

I would like to create a table of min/avg/max ping data using a script. The input would be a .txt of host names and their locations, the output should be a table of those names and their ip address and max, avg and min ping of the command ping -c 10 example.com It would be something similar to this: Answer

Advertisement