Questions tagged [awk]
AWK is an interpreted programming language designed for text processing and typically used as a data extraction and reporting tool.
57 questions
6votes
1answer
142views
Script to format Markdown as plain text
The following script is to convert Markdown files to something closer to my aesthetical expectations. It is not assumed to be bulletproof accurate and I don't mind to slightly adjust the output ...
5votes
4answers
524views
Generate filesystem usage report using Awk
I would like to request a review of an Awk program I have written. This script meets an immediate business need and, ideally, serves as a coding style example for new hires (who may not yet be ...
4votes
1answer
210views
awk script to pivot long CSV into wide CSV
I've made an awk script that does the same operation and has the same parameters as Python's pandas.DataFrame.pivot, for 2D tables. It reshapes a table from "...
3votes
2answers
150views
Processing a very long single line of comma-separated (?) floating point numbers
I have a sample svg file from the graphics program Inkscape. My objective is to collect every third pair from a very long line of floating point numbers. That seems simple enough. The larger objective ...
3votes
1answer
56views
Split Text to Columns and move all data to the next column
Objective I'd like to confirm if there is a more efficient approach for the working script below, which splits column data in my tsv files. I suspect this can be achieved with awk or maybe sed but my ...
4votes
1answer
155views
Awk program for extracting unique values from a k1=v1,k2=v2,... list
A single string consisting of comma-separated pairs in the format <key>=<value>, like ...
1vote
1answer
54views
Extract sections of a file into separate files
I have a file of the form - >SDF123.1 blah blah ATCTCTGGAAACTCGGTGAAAGAGAGTAT AGTGATGAGGATGAGTGAG... >SBF123.1 blah blah ATCTCTGGAAACTCGGTGAAAGAGAGTAT AGTGATGAGGATGAGTGAG.... And I want to ...
3votes
0answers
84views
The Blacklist v2
This script gathers domains listed from sources in this JSON file and compiles them into one text file. Text files that have a similar key under the whitelists ...
3votes
1answer
154views
Parse log file and send the result to an API
The task is to get the most recent login time of the day for each user. Then send such a result to an API. The log file (file.log) looks like the following (only ...
2votes
0answers
54views
bash / awk workflow operating on multi-column files [closed]
I am working on the improvement of the bash-awk workflow designed for the analysis of data in multiple-colums format. The script uses AWK code (which extract numbers from selected columns of the input....
2votes
1answer
99views
Printing of status message during execution of the bash script
As a part of my bash routine I am printing some message in terminal regarding status of the workflow. The message in splited into two parts (part 1: begining of the task, part 2: status of its ...
1vote
1answer
129views
Compare script using awk and bash
I try to create compare script using awk and another command and running successful. But I think the script I create it's to long. Is there anyone can shorten my script below ? After plan A ...
2votes
0answers
57views
Faster algorithm/language for substring sliding window replacement
I had a sample file with a long string >50M like this. ...
2votes
1answer
392views
Bash script wallpaper randomizer
I thought it would be fun to write a simple and small bash script which randomly chooses a wallpaper from a given directory of a set of wallpaper images. The code is as follows. ...
1vote
1answer
91views
Parse and clean large log files
I have the code below, which works successfully, and is used to parse, clean log files (very large in size) and output into smaller sized files. Output filename is the first 2 characters of each line. ...