Skip to content
Advertisement

Tag: awk

How to use awk regex sort by query string value?

I have a log file with example row: The 7th column of each row looks like this: Output is arranged according to the number of lines in decreasing order containing unique values of t. Desired OUTPUT: I am using awk but it is not giving desired output: It outputs all columns after 7th which is not required. What am I

Replace characters in specific columns only (CSV)

I have data like this: It has dot . as decimal separator but I need to use , instead. Desired data: I tried using Sed. With sed -i ‘s/./,/g’ myfile.csv I could replace all dots with commas but would destroy dates on the fourth column. How can I change dots to commas in elsewhere but leave the fourth column as

how to grep lines according to 6th field contents

I would like to know how to filter lines according to the mem usage: I would like to be able to find only the PIDs that (RES mem usage) exceed 5GB Explicitly, I have the following lines and I’d like to grep only the lines where the 6th field is larger than 5 GB EDIT: Note that sorting is not

Working with complex CSV from Linux command line

I have a complex CSV file (here is external link because even a small part of it wouldn’t look nice on SO) where a particular column may be composed of several columns separated by space. For viewing I am using this trick column -s,$’t’ -t < *.csv | less -#2 -N -S which is an upgraded version borrowed from Command

Awk asking combine two files

I have combined two different files with Same Key by AWK command. And In case there is no key match compare to File1 and File2 then just put “ttt” instead. I have below AWK command. Example Combine File1 File2 Then Expected result My AWK Command Show I already tried to do few way like below But looks like this is

Advertisement