Tagged: awk

About linux : Define-variable-in-AWK

Question Detail I am trying to mention varaibel in AWK. I try a few I used to use earlier, but can’t figureout where I am doing wrong… cat tld.csv co.uk com code while read...

About linux : I-want-to-date-sort-the-5th-col-using-sort-commandBut-the-problem-is-no-consistency-in-formatwhat-can-be-the-way-to-do-it

Question Detail M_ID,M_NAME,DEPT_ID,START_DATE,END_DATE,Salary M001,Richa,D001,27-Jan-07,27-Feb-07,150000 M002,Nitin,D002,16-Feb-07,16-May-07,40000 M003,AJIT,D003,8-Mar-07,8-Sep-07,70000 M004,SHARVARI,D004,28-Mar-07,28-Mar-08,120000 M005,ADITYA,D002,27-Apr-07,27-Jul-07,40000 M006,Rohan,D004,12-Apr-07,12-Apr-08,130000 M007,Usha,D003,17-Apr-07,17-Oct-07,70000 M008,Anjali,D002,2-Apr-07,2-Jul-07,40000 M009,Yash,D006,11-Apr-07,11-Jul-07,85000 M010,Nalini,D007,15-Apr-07,15-Oct-07,9999 tail -10 Joining_date.txt|awk -F, ‘{print $5}’ |sort -t, -k1.3M awk: line 1: syntax error at or near { Question Answer No...

About linux : Find-patterns-and-rename-multiple-files

Question Detail I have a list of machine names and hostnames ex) # cat /tmp/machine_list.txt [one]apple machine #1 myserver1 [two]apple machine #2 myserver2 [three]apple machine #3 myserver3 and, server each directory and each directory...

About linux : how-to-fetch-a-selected-value-from-a-text-file-using-a-shell-script

Question Detail I have a file which looks like this (myfile.txt) {“projectStatus”:{“status”:”ERROR”,”conditions”:[{“status”:”ERROR”,”metricKey”:”new_bugs”,”comparator”:”GT”,”periodIndex”:1,”errorThreshold”:”0″,”actualValue”:”2″}, {“status”:”ERROR”,”metricKey”:”new_reliability_rating”,”comparator”:”GT”,”periodIndex”:1,”errorThreshold”:”1″,”actualValue”:”3″}, {“status”:”ERROR”,”metricKey”:”new_security_rating”,”comparator”:”GT”,”periodIndex”:1,”errorThreshold”:”1″,”actualValue”:”2″}, {“status”:”OK”,”metricKey”:”new_maintainability_rating”,”comparator”:”GT”,”periodIndex”:1,”errorThreshold”:”1″,”actualValue”:”1″}, {“status”:”ERROR”,”metricKey”:”new_code_smells”,”comparator”:”GT”,”periodIndex”:1,”errorThreshold”:”0″,”actualValue”:”17″}, {“status”:”ERROR”,”metricKey”:”new_vulnerabilities”,”comparator”:”GT”,”periodIndex”:1,”errorThreshold”:”0″,”actualValue”:”2″}, {“status”:”ERROR”,”metricKey”:”coverage”,”comparator”:”LT”,”errorThreshold”:”90″,”actualValue”:”80.3″}, {“status”:”ERROR”,”metricKey”:”new_coverage”,”comparator”:”LT”,”periodIndex”:1,”errorThreshold”:”90″,”actualValue”:”7.826086956521739″}], “periods”:[{“index”:1,”mode”:”previous_version”,”date”:”2021-11-04T14:47:41+0000″}],”ignoredConditions”:false}} I have to pick “actualValue”:”7.826086956521739″ which is with “metricKey”:”new_coverage” then expected output is (actualValue)...