Skip to main content

Questions tagged [awk]

A pattern-directed scanning and processing language.

3 votes
4 answers
369 views

I'm working on wrangling some data into a matrix format for a PCA analysis. I have attempted a more straightforward version with R, but pivot_wider() fails due to the massive size of this dataset (~4....
Matteo's user avatar
  • 323
1 vote
2 answers
135 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
0 votes
2 answers
90 views

I have a few RHEL 8/9 boxes with a cron job that updates them automatically every week. The reboots are done manually from time to time and I would like to write a script to simplify the removal of ...
Fravadona's user avatar
  • 1,613
3 votes
5 answers
617 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
14 votes
1 answer
874 views

Consider this awk invocation: awk 'BEGIN {print 1}' There are no input files, so stdin is used for input. However, the program only contains a BEGIN pattern, so there is no need to read it. Does ...
emron's user avatar
  • 365
-1 votes
7 answers
615 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
4 votes
4 answers
485 views

How to remove comments and newline symbols without using two pipes. I have bookmarks.txt file with comments. https://cookies.com # recipes cookbook https://magicwands.com # shopping I can copy link ...
normal_max's user avatar
5 votes
5 answers
378 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
  • 323
-2 votes
1 answer
150 views

I have a dir containing logstash config files these files have filter blocks, and sometimes nested child blocks need to match whole filter block filter { any text till final matching closing brace for ...
Sollosa's user avatar
  • 2,009
-2 votes
4 answers
202 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
-4 votes
6 answers
250 views

I have a file (FILE1) with some repeated sections as below (example): LINE 1 ABCD LINE 2 EFGA LINE 3 HCJK REMOVE LINE11 REMOVE LINE12 REMOVE LINE13 LINE 4 ABCDH LINE 5 EFGAG LINE 6 HCJKD REMOVE ...
Pratap's user avatar
  • 45
2 votes
6 answers
679 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
1 vote
2 answers
129 views

I'm new to Bash and I've been self-taught. I think I'm learning well, but I do have staggering gaps in my base knowledge. So sorry if this is woefully simple bbuuuttt... Essentially, I need to sift ...
TC575's user avatar
  • 13
0 votes
5 answers
214 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
6 votes
7 answers
1k views

In Linux there is a file numbers.txt. It contains a few numbers, all separated with space. There are numbers like this: 5476089856 71788143 9999744134 114731731 3179237376 In this example only the ...
Banana's user avatar
  • 241

15 30 50 per page
1
2 3 4 5
561