Skip to main content

Questions tagged [awk]

AWK is an interpreted programming language designed for text processing and typically used as a data extraction and reporting tool.

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 ...
john_m's user avatar
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 ...
Thure Dührsen's user avatar
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 "...
user avatar
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 ...
Bryan-StackExchange's user avatar
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 ...
El_Birdo's user avatar
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 ...
Amaterasu's user avatar
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 ...
user1995's user avatar
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 ...
T145's user avatar
  • 3,147
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 ...
Marc's user avatar
  • 5,684
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....
Hot JAMS's user avatar
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 ...
Hot JAMS's user avatar
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 ...
Ario's user avatar
2votes
0answers
57views

Faster algorithm/language for substring sliding window replacement

I had a sample file with a long string >50M like this. ...
hey0god's user avatar
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. ...
user avatar
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. ...
rogerwhite's user avatar

153050per page
close