awk tag

13 questions


1 answers
305 views
0
Awk's output doesn't go as well as I want.

When you actually run the code below, 203100B203101K...I would like you to write A for all the characters.Could you tell me what's wrong?#!/usr/bin/awk-fUS>BEGIN{ for(i=0;i<=40;i++){ zyu[i] = int(...

awk
2 years ago

1 answers
416 views
0
I want to separate each new line with awk and extract a record with a specific string in grep.

How do I extract a record from address.txt that is separated by line breaks to four records and contains the string Pass?If you enter the following command, you will see all output.cat address.txt |aw...

2 years ago

1 answers
118 views
0
Can awk patterns be dynamically configured with variables?

instead of simple variable expansion echo-e 1 2 3 \\n4 56 \\n789 |awk $1 == 1, $2 == 2, $3 == 3If so, of course you can get line 1 2 3 How can I get patterns if I use variables here?Specifically Varia...

awk
2 years ago

1 answers
126 views
0
Understanding How to Analyze Maillogs, Aggregate them to One Line, and Output them

environment:CentOS 6.9Thank you for your help.It was very helpful that you previously taught me how to use awk to extract mail logs for a specified period of time.I was thinking a lot about improving ...

2 years ago

5 answers
81 views
0
Remove commas in CSV data

A, 100, ZB, 1,000, ZC, 1,000,000, Z↓A, 100, ZB, 1000, ZC, 1000000, ZI would like to change it to , but what do you do with sed, awk, linux, etc.?

2 years ago

2 answers
80 views
0
How do I get only the diagonal with awk?

1 2 34 5 67 8 9When there is data (aa.txt), under the constraint of using awk only.How do I get 1,5,9 (or 3,5,7) diagonally?My name is awk'NR==i{print$i}'aa.txtI thought I could do it if I looped, bu...

awk
2 years ago

1 answers
129 views
0
How do I apply awk to the path within the shell script?

In the shell script, I wanted to get the directory at the bottom of the path specified in the argument, so I wrote:■test.sh #!/bin/shmyfol=`awk-F/{print$NF}${1}`mylog=2016_${myfol}.txttouch${mylog}■ R...

2 years ago

5 answers
102 views
0
I want to see the results of multiple Bash commands in one line.

Thank you for your help. uname-n; cat/proc/meminfo | head-1 | awk' {print$2}'server11112233The result was This result can be used as a result of the sever1112233I would like to ask if there is a good ...

2 years ago

3 answers
106 views
0
Understanding How to Extract Hierarchical Strings

We would like to process the following text file into CSV file format using shell script.If it can be processed on Linux, I don't care about the method.I can't think of a way to realize it, so I would...

2 years ago

2 answers
84 views
0
awk's efficient program

I am using gawk5 at the Windows 10 command prompt.There are 10 files from ss1.txt to ss10.txt, and 10 corresponding awk programs from fff1.awk to fff10.awk.If you run them in a batch file, you get 10 ...

2 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.