I've tried awk: awk -v RS="zuzu_mumu" '{print RS $0}' input_file > output_file The obtained file is the exact input_file but now the first line in file is z
I am learning awk and I would like to know if there is an option to write changes to file, similar to sed where I would use -i option to save modifications to a
I have a very large text file (tab-delimited, first line is header) like this: A1 A2 A3 A4 A5 A6 A7 FA1 AB 234 231 0.02 456 I FA2 ACE 241 2154
I was wondering if there a generic way to extract a specific string which by design is an eleven characters alphanumeric string using awk approach? for ex- cat
I am trying to make a script (and a loop) to extract matching lines to print them into a new file. There are 2 conditions: 1st is that I need to print the value
Content of a json file "iso_checksum": "md5:32fdf4fef4ef" I have stored value of new checksum in a variable v = "4dfv45ffdf" I want to replace the value after
I am trying to to get list of active Wordpress plugins and for that I am using wp plugin list --status=active --allow-root command. That gives me putout like t
I've been trying to get a one liner working updated to add the user name for the processes consuming swap on the system but having a hard time getting it to wor
I have data in a file test.txt in below format. abc,123,mno,xyz,1234 mno,123,abc,rpt,pqr,2345 xyz,456,uyt,rtp,rto, I want to capture the 3rd field which I am a
I use the following command to output PID and FD related to CLOSE-WAIT sockets. sudo ss -p | grep CLOSE-WAIT | awk '{ print $7 }' | sed 's/,pid=/ /' | sed 's/,f
I have a 70 GB csv file (data.csv) that has the following structure Timestamp,Price,Volume. 1649289600174,100,100 1649289600176,105,100 1649289600178,109,100 16
I wrote the below script to check expiry age of users on psql #!/bin/bash echo "" echo "Performing User Expiry Check" echo "" CONTAINER_ID=$(docker p
I have a file with three columns. I would like to extract rows with top two values in column 3 for each unique value in column 2. cat file.list run1/xx2/x2c1.tx
I can use the following code to generate a string. $ awk -e 'BEGIN { for(i=1;i<=10;++i) s = s "x"; print s }' xxxxxxxxxx But its complexity is super-linear
I have a data file, let's call it fileA. It has two columns and I want to take difference of 2nd column and multiply the output with 13.6 and write it down in 3
I have a fasta file with several sequences, but the first line of all the sequences start with the same string (ABI) and I want to change and replace it with th
I am trying to make a script to check if the value snp (column $4 of the test file) is present in another file (map file). If so, print the value snp and the va
I have put togheter in an awk script, the average and standard deviation from 2 columns (weight,height) and the % of olympic medals achieved (sum and group by m
I get error "awk: fatal: cannot open file `print' for reading (No such file or directory)" when executing this command in jenkins pipeline. sh """ssh -o StrictH
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