awk

  1. A

    Haproxy question AND "or" condition while using AWK

    I have multiple AWK queries I get haproxy metrics value by them but sometimes the query return no value neither any other messages - just empty string. How can I improve the query to return any other value if it's sent empty string? And what value I can use in the above keys to signalize the...
  2. S

    Creating a grouped tab separated file with a flat list

    Crosspost: https://www.nixcraft.com/t/converting-a-list-into-a-tab-separated-file-grouped-by-values/4517 Hello Linux.org, This is my first post here and I'm hoping the community is inviting to novice shell scripters. So let me share. I have a text file with a list of values. Here is a snip...
  3. P

    Multiplying the decimals in the column

    Hi, I want to multiply only the second column by 27.211396132 . I use awk '{$2=$2*27.211396132 ; print }' input file > output file The result is wrong . I want the answer to be like 5 -76308.842049 ( for the first line). Please help me...
  4. M

    Search directory and search File

    How can i first search with certain filename with wild card and then search a string in those filename and get the output. E.g Directory name : abc/def/xyz/ Files in directory : Abc12, abc13, abd12,abc14,abc15, abe12 and so on. First search : ab*12 Output : abc12,abd12,abe12 Now search...
  5. A

    Keep one ID based on value of a column?

    hellow, i have a tab delimeted file: GH76.hmm - 358 VENTURIA_I_00885.t1 - 411 7.50E-83 273.9 26.1 1 1 7.80E-85 2.30E-82 272.3 26.1 15 354 24 406 21 410 0.87 GH105.hmm - 332 VENTURIA_I_00885.t1 - 411...
  6. ylspirit

    Awk tutorial: awk syntax and awk examples

    https://www.linuxcommands.site/linux-commands/awk-syntax/
  7. P

    Rearrange Header and Data of different versions of Text file based on a Master File

    I want to re-arrange the data (Header and Detail) in multiple pipe delimited text files, in the order specified in a reference master file and create a single output file, using shell script. The order of the columns will be different in different input files. Data could be empty for the...
  8. nikolaymartin

    Awk Multiterm Match

    I want to match multiple search terms in awk with a single command. How ca i specify multiple search terms to math?
  9. iridakos

    Remove duplicate lines from files keeping the original order (one-liner explained)

    Hi all, I published a post providing ways for removing duplicate lines from text files keeping the original order and a thorough explanation of how the awk one-liner works. https://iridakos.com/how-to/2019/05/16/remove-duplicate-lines-preserving-order-linux.html Hope you find it useful
Top