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
Tag: awk
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
Linux bash script removing part of string line by line
After greping output of command i have get below result: PAPU 0 1000 GPRS ATTACH SUCC GB 2400 2382 2333 (10) 1244 GPRS ATTACH FAIL GB 1216 1219 1252 (10) 16000 GPRS ATTACH SUCC IU 986 986 1027 (10) 16001 GPRS ATTACH FAIL IU 170 185 171 (10) 2000 PDP-C ACTIVATION SUCC GB 5356 5138 5030 (10) 2109 PDP-C ACTIVATION
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
Remove only Alphabetic Character lines in a linux file by using Sed/Awk
I have a linux file. In that file, some lines are there merge as with numeric and alpha charcters. I want to remove only alpha characters lines.. Let us consider a file with the sample contents as below: remove only #Terry Kalkas Lans Road, Beaver Falls PA kind of lines. I want to see Please share your Ideas Answer You
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
Merge two lines into one and add character
I’v got a output like: I need to merge the strings and add symbol “R” betwen them like: How i can do it? Thanks Update. Sorry. Here is the comand Here is the output: I need output like: Answer
How to manipulate text lines and Create two separate files for odd and even
How to manipulate text lines and Create two separate files for odd and even ? file 1: file 2: Answer I’d say This will print lines in inputfile that end with 1, 3, 5, 7, or 9 to file1 and all others to file2.
How to insert a new record(row or line) after the last line of input file using awk?
The marks of the students are given as a table in the following format Name | rollno | marks in exam1 | marks in exam 2 … i.e. There is one record per line and each column is separated by a | (pipe) character.At the end of all the records I want to add extra lines which contains information about