awk is a special-purpose, interpreted programming language for extracting and reporting data.
493 questions- Bountied 0
- Unanswered
- Frequent
- Score
- Unanswered (my tags)
How to separate fields with space or tab in awk
While playing with awk I came to execute: ls -la >> a.txt ; awk {'print $5 $1'} a.txt ; This is giving output like: 53277-rw------- 52347-rw------- How can I get a space between these two ... command-line text-processing awk- 96.1k
What does this command mean: awk -F: '{print $4}'?
Please explain what does following command mean: awk -F: '{print $4}' command-line awk- 2,528
How can I merge files on a line by line basis?
cat file1 foo ice two cat file2 bar cream hundred Desired output: foobar icecream twohundred file1 and file2 will always have the same amount of lines in my scenario, in case that makes things ... bash text-processing sed perl awk- 1,285
How can I process multi-line records with awk in a bash script?
example.txt is below Restaurant: McDonalds City: Miami State: Florida Address: 123 Biscayne Blvd Phone: 911 Restaurant: 5 guys City: Atlanta State: Georgia Address: 123 Peachtree Rd Phone: 911 ... scripts awk- 275
Difference of two big files
I have "test1.csv" and it contains 200,400,600,800 100,300,500,700 50,25,125,310 and test2.csv and it contains 100,4,2,1,7 200,400,600,800 21,22,23,24,25 50,25,125,310 50,25,700,5 now diff test2.... grep sed awk diff- 6,451
How do I replace multiple lines with single word in file(inplace replace)?
Content of my filename file is as following(for example): My block of line starts from here START First line second line third line END and end to here for example. I want to replace block of lines ... command-line text-processing sed awk perl- 33.6k
How to delete lines starting with certain strings
Is there a way to delete lines starting with certain strings. I have this youtube-dl code youtube-dl --extract-audio --audio-quality 0 --newline --audio-format mp3 command-line grep sed awk youtube-dl- 575
grep to return Nth and Mth lines before and after the match
I know that with grep I can use the fields -A and -B to pull previous and next lines from a match. However they pull in all lines between the match based on however many lines are specified. grep -... command-line grep awk- 225
Extract word from string using grep/sed/awk
I have a string 00:28:04 /usr/lib/jvm/jre/bin/java -DJDBC_CONNECTION_STRING= -Dspring.profiles.active=qa -XX:MaxPermSize=256 and want to extract the word qa that follows -Dspring.profiles.active. ... command-line bash grep sed awk- 471
How to remove the first colon ':' from a timestamp?
I am new to programming!! Can anyone help to remove the : at the first position in a timestamp: :29.06.2019 23:03:17 Presently I am trying to do it using awk/cut commands as shown below: TDS="$(... command-line bash awk cut-command- 333
awk - How to print the number of characters for the first n lines in a file?
I have a command: $ awk '{ print length($0); }' /etc/passwd It prints number of characters of every line in a passwd file: 52 52 61 48 81 58 etc. How can I print the number of characters for only ... command-line text-processing awk- 167
Do I need to install awk or is it inbuilt in Ubuntu?
I'm new to Linux OS and studying Mobile Computing. I have to analyze files using awk. I'm using Ubuntu 14.04. Do I need to install awk or is it inbuilt in Ubuntu? 14.04 awk- 1,461
How to use sort on an awk print command?
I have a couple of commands in an awk script I'm writing: print "Here are some players and their numbers, sorted by last name" if(sum[x] > 500) {print x, $2} Which outputs: Here are some players ... command-line text-processing awk- 405
Only get the H+W geometry of my screen without the later +x+y
I am reading this article. There is a statement there that goes: ffmpeg -f alsa -ac 2 -i hw:0,0 -f x11grab -s $(xwininfo -root | grep 'geometry' | awk '{print $2;}') -r 25 -i :0.0 -sameq -f mpeg -ar ... command-line awk- 171
Using AWK to get second column
I can not seem to get the awk command to get the second column of data. Bash Code: filter_data=$(awk "{if(/$filter:/) print $2}" < scanresults_temp.txt) printf "$filter_data \n" The $filter ... bash grep sed awk- 93
15 30 50 per page12345…33 Next