Skip to content
Advertisement

Tag: awk

Finding an exact match in QNX without using grep -w

I’m writing a script that needs to find an exact match in a file that is compatible with QNX and POSIX compliant Linux more detail: Im trying to find the user of a process so the original command I wrote was which works perfectly in POSIX compliant Linux however, QNX isn’t totally POSIX compliant and grep -w isn’t usable for

Generate a report using awk

I have /etc/fstab entries on 100 servers and i’m trying to write a awk script to identify following. What i need is, first my awk script need to print the domain name, then it should print tools incorrectly mounted on store and is not valid, but kdump01 mounted correctly on kdump , ops mounted correctly on ops) How can i

How can I delete a specific text in a text file

I have a text file : and I want to delete 192.168.47.1 line I tried but output is : I tried sed ‘s/192.168.47.1//g’ but again output is : I searched on google but but I am not able to find the right one. Answer The problem is that your pattern matches 3 lines in your data. You need to end

Running statistics on multiple lines in bash

I have multiple HTTP headers in one giant file, separated with one empty line. I have approximately 10,000,000 of headers separated with an empty line. If I want to discover trends, like header order, I want to do aggregate headers to a one-liner (how I can aggregate lines ending with an empty line and do that separately for all headers?):

Join two csv files

csvfile1 csvfile2 expected output I would like to combine the columns longitude,latitude and timestamp of both the files. There are two longitudes and two latitudes in csvfile2. So i want to compare if it matches any one of the longitude-latitude pairs along with the timestamp. And the column name order is also different in both the files. Any help would

How to remove some string with awk/sed or another command in linux?

I want to ask, how I can remove some string with command in linux? and the output: Answer try: Making field separator as | then substituting the starting zeros with NULL of 111th field as per your requirements, mentioning 1 will print the newly edited line(if any zeros were replaced with NULL), setting Output field separator as | and mentioning

Advertisement