Questions tagged [awk]

-5 votes
0 replies
AWK Combine multiple command [closed]
These are the Extraction commands from A huge excel zip file. I want to run below commands in one commands please review and suggest solution. a...
asked 4 months ago
0 votes
2 replies
awk to split field twice using two deliminator with condition
In the awk I am splitting on the space or : after the chrxx (it is not consistent so I added both as FS, then splitting on the -. I can not seem...
awk
asked 4 months ago
0 votes
0 replies
Expression is verified as valid but returns nothing when used with AWK
I'm trying to use AWK to extract a value from a file using this AWK command; awk '/(?:\"id\"\:[0-9]+)/{print $NF}' data.out The RegEx I'm usin...
asked 4 months ago
0 votes
0 replies
How to replace a FNR option value of AWK command in a for loop? [duplicate]
This question already has an answer here: Difference between single and double quotes in Bash...
asked 4 months ago
0 votes
0 replies
How to add a name below a specific search [duplicate]
i would like to translate this input file using sed or awk: input 1 AA 3 BB 5 CC output 1 AA 3 BB 3 GG 5 CC the closest syntax I found on thi...
awk
asked 4 months ago
0 votes
1 replies
Merge multiple files and split output to multiple files based in each column (post 2)
I have many csv files with exactly same format on rows and columns. In the example below I present only 2 files as input, but i have a lot files...
awk
asked 4 months ago
0 votes
1 replies
grep out url from html files and pick top one somehow
I have a many (think 17,000) html files that contain links. Each html file can contain many links but they all reference the same video mp4 but i...
asked 4 months ago
0 votes
2 replies
How to represent many parts of awk sub/gsub's matched string
How to represent more than one part of awk sub or gsub's matched string. For a regexpr like "##code", if I want to insert a word between "##" an...
asked 4 months ago
0 votes
1 replies
Convert normalization from Pandas to AWK to improve performance
I have a single cell RNA-sequencing dataset which I want to normalize, however due to it's size (>1,000,000 cells, ~23,000 genes) using Python...
asked 4 months ago
2 votes
2 replies
problem with shell script to get last logs for 10min
I wrote a script that check last httpd error logs for the last 10 min but i got an error it stay looping: the problem is that the output of the s...
asked 4 months ago
3 votes
3 replies
Explanation about awk command using ORS, NR, FS, RS
I have a sample data set of : 1 2 3 4 5 6 which is successfully parsed by the following awk command into the desired output awk 'ORS=NR%3?FS:...
asked 4 months ago
1 votes
3 replies
How do you count the number of rows that meet a numerical condition in AWK?
I have a 2 column text file that is sorted on column 2 (numbers, ascending) that I am trying to summarise by counting the number of lines that fa...
awk
asked 4 months ago
-1 votes
0 replies
List files with file name based re-ordering and meta file length output - soxi and bash
I got a script that spits out file names and file lenghts of audio files using bash and sox. The script currently cycles through specific named f...
asked 4 months ago
0 votes
0 replies
Join Files in Unix /Java using Wildcard columns
How to join two files in Unix with wildcards and no key column? In SQL we can do : Select T1.Col1, T2.Col_Group, T2.Priority from table1 T1 joi...
asked 4 months ago
-2 votes
0 replies
Merge multiple files and split output to multiple files based in each column
I have many csv files with exactly same format on rows and columns. In the example below I present only 3 files as input, but i have a lot files...
awk
asked 4 months ago
-1 votes
2 replies
Is there any if statment in awk to compare a word greped from a file?
I am new to any programming and shell scripting. I am trying to make a if condition in shell script. I am used of some computed codes for densit...
awk
asked 4 months ago
0 votes
1 replies
How to find records with minimum value in a specific column in multiple files?
I have 2 column 4000 dat files. from each file, I need to identify first mimum value of column 2 and print corresponding row. Then this should ru...
awk
asked 4 months ago
0 votes
2 replies
How to add two columns based on header names and paste results in a third row based on header name?
How can I add 2 columns (test 1 and test 2) and print the result in a fourth column based on column header names? (CSV file)- comma demilited fil...
asked 4 months ago
1 votes
3 replies
Indent long line stdout
Let's say I have a standard 80 columns terminal, execute command with long line output (i.e. stdout from ls) that splits into two or more lines,...
asked 4 months ago
-1 votes
1 replies
Getting duplicate entries on multiple sed runs
I am using the following sed command to get rid of duplicates But it is still causing duplicate entries on multiple runs sed -i '/^text1/i\valu...
asked 4 months ago
-3 votes
3 replies
How to rewrite a file and move non-maching line above. Regex [closed]
I have a text file with lines in a format like that: "\\server\folder\file name dad dada dad","submitted" "\\server\folder\file name dad dada xx...
asked 4 months ago
1 votes
2 replies
printing information of two files according specific field
I have two files. I need to print information like the example, when the first field exist and is equal, in two files. file 1 20;"aaaaaa";992929...
awk
asked 4 months ago
3 votes
3 replies
Piping output to a bash function with multiple inputs
Here is what I am trying to do: I want to measure the Levensthein distance between two strings, using bash. I found an implementation of the LD h...
asked 4 months ago
1 votes
3 replies
Why using awk in bash like vlookup in Excel give empty output file?
The good using of awk is still unclear for me, but I know it will be useful for what I want. I have two files, both are tab delimited: transcri...
asked 4 months ago
0 votes
3 replies
Adding a value next to the last field of a csv file to each record using sed command in unix
I have a trouble in writing a sed command to add a value to each record as new field , next to the last column (sometimes values being null), in...
asked 4 months ago