Category "awk"

batch rename matching files using 1st field to replace and 2nd as search criteria

I have a very large selection of files eg. foo_de.vtt, foo_en.vtt, foo_es.vtt, foo_fr.vtt, foo_pt.vtt, baa_de.vtt, baa_en.vtt, baa_es.vtt, baa_fr.vtt, baa_pt.vt

Output of awk in color

I am trying to set up polybar on my newly-installed Arch system. I know very little bash scripting. I am just getting started. If this is not an appropriate que

Grep exclude count of occurence match between comments <!-- --> of curl body

I am very new to linux & bash script. I'm trying to read an xml file using curl command and count the number of occurrence of the word </entity> in it

How to not remove but only print multiply rows from CSV file using a awk?

i have the following code awk -F, '{key=$1 FS $2 FS $3} NR==FNR{a[key]; next} !(key in a)' dubl.txt original.txt which checking for duplicates in multiply colu

Parse Text with "awk" and Modify One Of The Columns With "sed"

I have a data seperated with pipe "|" and I would like to parse it with awk and write it into a DB. EndpointRequest|ID-ip-172-31-70-119-eu-west-1-compute-intern

Mathematica : Convert easily a Notebook format into Wolframscript (.wls) by removing all comments on real instructions lines

I have a Mathematica notebook. I would like to generate in an automatically way this notebook to a Wolfram script that I could make run directly from terminal u

AWK return/print as associative arrays in Bash

With this command I am trying to filter through my firewall. In order to extract the firewall rule ID number and the IP address. existing=($(ufw status numbered

Awk get 2 columns and count repeated values in new column

The following script is made to create a new csv getting the gender and state columns and counting the repeated values and grouping them by states, but it doesn

AWK remove query params from URL

I have access.log file with >1m lines. The exaple of line: 113.10.154.38 - - [27/May/2016:03:36:26 +0200] "POST /index.php?option=com_jce&task=plugin&

select subdomains using print command

cat a.txt a.b.c.d.e.google.com x.y.z.google.com rev a.txt | awk -F. '{print $2,$3}' | rev This is showing: e google x google But I want this output a.b.c.d.e

How to substitute alternate positions in a string using awk

I have a lookup file that I use to search the available records in file_2 and if such records are present then replace those records with #. Currently my code i

awk split on first occurrence of character

Trying to use awk to split each line. If there is more the one p or q the second split on the ( does not work correctly (line 2 is an example. I am not able to

Standard Deviation from multiple files in bash

I wish to calculate the standard deviation from a range of files titled "res_NUMBER.cs" which are formatted as a CSV. Example data includes 1,M,CA,54.9130 1,M

Change indented multiline string in file in terminal

i want to change multiline string within particular marks that is indented in file, example looks like this: non_important_array: [ text ], impo

What's the most robust way to efficiently parse CSV using awk?

The intent of this question is to provide a canonical answer. Given a CSV as might be generated by Excel or other tools with embedded newlines and/or double quo

how to clear map in awk?

I have a file a.txt. There are many numbers in each line in a.txt: 1 2 3 1 2 5 6 7 7 19 20 20 I have to print each line without duplicate numbers, just like

rename files that match strings in a txt file

I am trying to rename multiple files according to the match to a .txt file my files are GCF_000698265.1_ASM69826v1_genomic.gff.gz GCF_000785125.1_ASM78512v1_gen

How to sum the values in one data column of duplicate rows with awk and remove the duplicate rows?

I have a CSV file with a heading row and multiple data rows each with 11 data columns like this: Order Date,Username,Order Number,No Resi,Quantity,Title,Update

Error from server (NotFound): pods "$(kubectl" not found

In the minikube hyper-v machine I did deployment of sawtooth-0, using sawtooth config file. Now when I am checking running pods it seems to have some default o

Ignore header when performing awk command - not working

I know several questions have been asked about ignoring the header using the awk command, but I have tried a bunch of the suggested methods and it still isn't w