Skip to main content

Questions tagged [awk]

A pattern-directed scanning and processing language.

Filter by
Sorted by
Tagged with
1 vote
2 answers
131 views

I have a folder with many subfolders full of various Quarto(reg) files & in those files there are links that are located in varying positions in the file lines. UPDATE ON 3 November 2025 in ...
iembry's user avatar
  • 205
3 votes
5 answers
611 views

I want to print the part before a matching pattern with awk. The original problem is, I want to get the service name from kubernetes pod names. We have pods with names like some-name-and-foo-[[:alnum:]...
WesternGun's user avatar
-1 votes
7 answers
605 views

I want to print a colon after every 2 characters of alphanumeric Value and I found something like below. But I am not sure how to remove initial 2 characters from the output and what is the meaning of ...
user984993's user avatar
5 votes
5 answers
365 views

I'm working with several files which come in bundle of four, across groups the bundels have the same number of columns; see below for an example showing the first four rows with header: File1 has ...
Matteo's user avatar
  • 283
-2 votes
4 answers
195 views

I'd like to retrieve data from here https://www.sbs.com.au/ondemand/tv-series/la-unidad/season-1. I wget the page to file. The data I seek is in the form of (samples): https://www.sbs.com.au/ondemand/...
Tony Puryer's user avatar
2 votes
6 answers
672 views

Please see my linux bash script below. I can't achieve my target output with my current code. It keeps reading the whole column 4. input_file.txt: REV NUM |SVN PATH | FILE NAME |DOWNLOAD ...
user765641's user avatar
0 votes
5 answers
213 views

In Linux in a directory there are files, ls -1 shows me this output : file1.1-rvr file1.2-rvr file1.3 file1.4-rvr file1.5 file1.6-rvr file2.1 file2.2 file3.1 file3.10 file3.2-rvr file3.3-rvr file3.4 ...
Banana's user avatar
  • 241
1 vote
2 answers
93 views

A common way awk scripts are written is to use top-level pattern-action blocks. The file would then consist of multiple top-level pattern-action blocks. Each block would apply to input lines matching ...
Filangieri's user avatar
3 votes
1 answer
269 views

Have written some code in an awk file. Basically the code captures lines starting with ### DK and returns the block between two blank lines. Would like the capability of either using a function or ...
Filangieri's user avatar
2 votes
3 answers
224 views

I would like to build a report coming from the output of certain commands. For instance, I have the output of such command: systemctl --type=service --state=running | grep -e cron -e apache2 -e ...
Nick's user avatar
  • 29
1 vote
3 answers
128 views

I have a PDB file (coordinates of atoms in a protein) on a Linux machine: ATOM 1 N GLY A 1 0.535 51.766 5.682 1.00 0.00 ATOM 2 CA GLY A 1 -0.712 50....
Paolo Lorenzini's user avatar
2 votes
3 answers
325 views

I have a program that will run a set of commands against new server installs and I need to change an entry in a file for each install. We need to change the default DNS from 127.0.0.X (which it ...
The ScaryJello's user avatar
1 vote
2 answers
122 views

Consider a command which takes arguments like this: cmd foo bar baz [arbitrary args...]. How do you build a filter of AND patterns based on those arguments? Something like this pipeline of greps: grep ...
mbigras's user avatar
  • 3,502
3 votes
3 answers
520 views

From the info below: $ cat access.dat 2025/01/01T10:00:01 "GET" /path/resource/api1 User1 500 2025/01/01T10:00:01 "DELETE" /path/resource/api1 User1 503 2025/01/01T04:00:01 "...
Ismael Sanchez's user avatar
7 votes
10 answers
3k views

I have an output similar to 975 Jan/21 - 19:59:36 ### sed "/^#include_dir/a include_dir = 'conf.d'" /opt/db/data/efa_bauen_ni_14/postgresql.conf 986 Jan/21 - 20:04:21 ### grep -l "...
vrms's user avatar
  • 287
3 votes
2 answers
692 views

I have a CSV file with 100 million rows, approximately 60GB in size. Now, I want to create another CSV from it but only take lines that match a certain condition: at the end of the CSV, there is an ...
membersound's user avatar
0 votes
4 answers
342 views

My file has two columns containing the date and the precipitation in mm for every day. 2024/01/01 5 2024/01/02 0 ... 2024/12/26 15 2024/12/27 0 Now I will multiply the second column of the file after ...
Eddy Sorngard's user avatar
-5 votes
1 answer
114 views

I need to print outs of cert file blocks one by one ---BEGIN--- AA BB CC --END CERTIFICATE--- --BEGIN--- AA BB CC --END CERTIFICATE-- would need out put for running in a loop some thing like for i in ...
BSingh's user avatar
  • 1
3 votes
4 answers
762 views

I am trying to convert delimited data format to html column table output for email printing and I am unsure how to use pipe delimiter as a separater for HTML tabular formatting. Below is what I could ...
Christopher Karsten's user avatar
0 votes
2 answers
112 views

First, I got the total size of folder /my-downloads: $ du -sh /my-downloads 304G /my-downloads As you can see, it's 304G. Then, I wanted to find out the total size of all immediate directories ...
Logan Lee's user avatar
  • 259
2 votes
3 answers
115 views

I have a pretty basic text file on a Linux machine that has stuff like Chapters, Dialogues and References. This is what it looks like Chapter: 1 One: Birds and Trees Birds are beautiful and trees ...
learningregularexpressions's user avatar
0 votes
4 answers
316 views

I have file where I need to find if some column is empty. File is delimited by ; Some of data contains & in word and awk is command it not working for same . Lets say I have file (...
pbh's user avatar
  • 101
-2 votes
2 answers
159 views

I have line * {@jira: PIVOT-9968} Provide a way to pass an `IMemoryCollector` to `IInternalMemoryMonitored#getMemoryStatistics(memoryCollector)` in order to prevent the count of duplicated blocks. I ...
MikiBelavista's user avatar
1 vote
4 answers
278 views

I'm trying to pull the date and IP address from the output of lastb I'm using: lastb | awk '{print $5,$6,$7,$3}' The problem is that sometimes the first column (userID) of lastb is blank: Data ...
ZacWolf's user avatar
  • 193
2 votes
3 answers
490 views

In the file groupAfiles.txt are the lines: file14 file2 file4 file9 I need a way to convert them to remove file and add /dev/loop and put them all in one line with a space between them. /dev/loop14 /...
user447274's user avatar

1
2 3 4 5
169