]/Application/2.0/nirvana/logs$awk ‘$10 ~ /MIDS/ {print NR,$1,$2}’ test.log1 2014-07-21 20:00:53,3792 2014-07-21 20:00:53,4063 2014-07-21 20:00:53,431
Here ~ It is the start of the mode. If it is an inverse of the Mode !~, // Is a regular expression.Put the results in the file and directly use redirection.
Use if else to redirect to a file group
$awk ‘{if($10 ~ /MIDS/) print > “mids.txt”;else if($6 ~ /CCDL/
regular expressionPut the results in a file and use redirection directly.grouping files by using if else redirection$awk ‘{if($10 ~ /MIDS/) print > “mids.txt”;else if($6 ~ /CCDL/) print > “ccdl.txt”; else print > “cc.txt”}’ test.logDemo Small Case#计算log文件的大小$ls -l *.log|awk ‘{sum+=$5} END {print sum}’102610686#打印99乘法表$seq 9 | sed ‘H;g’ | awk -v RS=’‘ ‘{for(i=1;i
Http://blog.chinaunix.net/uid-25120309-id-3801250.htmlI. AWK descriptionAwk is a programming language that is used to process text and data under Linux/unix. Data can come from standard input, one or more files, or the output of other commands. It supports advanced functions such as user-defined functions and dynamic regular expressions, and is a powerful programming tool under Linux/unix. It is used in the command line, but more is used as a script.A
Simple to use:Awk: Performs an operation on a single line of the file in solitude.Awk-f: ' {print $1,$4} ': Use ': ' to split the line and print the first fourth field of the line.Detailed Description:AWK Command IntroductionThe most basic function of the awk language is to browse and extract information in a file or string based on the specified rules, before awk extracts the information for other text ope
Linux awk command details
Introduction
Awk is a powerful text analysis tool. Compared with grep search and sed editing, awk is particularly powerful in data analysis and report generation. To put it simply, awk refers to reading files row by row. Each line is sliced with spaces as the default separator, and the cut par
awk is a row processor: Compared to the advantages of screen processing, there is no memory overflow or slow processing when processing large files, usually used to format text informationThe awk processing process:Each row is processed in turn, and then the outputawk command form:awk [-f|-f|-v] ' begin{}//{command1; Command2} end{} ' file [-f|-f|-v] Large parameter,-F specify delimiter,-F call script,-v de
Shell programming --- awk command explanationAwk ProgrammingAwk is a programming language. Gawk is the latest version. The current linux version uses gawk.Awk is a soft link of gawk.How awk worksBEGIN # Run the command before the object row is read.The main input loop is executed repeatedly until the termination condition is triggered.END # RunThree methods for calling awk1. Enter a command in the shell com
Tags: Unix special ike split file FNR proc ... memfreeawk is a row processor: Compared to the advantages of screen processing, there is no memory overflow or slow processing when processing large files, usually used to format text informationThe awk processing process:Each row is processed in turn, and then the outputawk command form:awk [-f|-f|-v] ' begin{}//{command1; Command2} end{} ' file [-f|-f|-v] Large parameter,-F specify delimiter,-F call scr
awk is a row processor: Compared to the advantages of screen processing, there is no memory overflow or slow processing when processing large files, usually used to format text informationThe awk processing process:Each row is processed in turn, and then the outputawk command form:awk [-f|-f|-v] ' begin{}//{command1; Command2} end{} ' file [-f|-f|-v] Large parameter,-F specify delimiter,-F call script,-v de
1.awk IntroductionAwk is a programming language that is used to process text and data under Linux/unix. Data can come from standard input, one or more files, or the output of other commands. It supports advanced functions such as user-defined functions and dynamic regular expressions, and is a powerful programming tool under Linux/unix. It is used in the command line, but more is used as a script. awk handl
1. Introduction to AwkAwk is a programming language that is used to process text and data under Linux/unix. Data can come from standard input, one or more files, or the output of other commands. It supports advanced functions such as user-defined functions and dynamic regular expressions, and is a powerful programming tool under Linux/unix. It is used in the command line, but more is used as a script. awk handles text and data in such a way that it sc
I. AWK descriptionAwk is a programming language that is used to process text and data under Linux/unix. Data can come from standard input, one or more files, or the output of other commands. It supports advanced functions such as user-defined functions and dynamic regular expressions, and is a powerful programming tool under Linux/unix. It is used in the command line, but more is used as a script.Awk's way of working with text and data: It scans the f
Linux Text Formatting tool awk
I. Text processing tools
Grep, sed, and awk are both text processing tools. Although both are text processing tools, they both have their own advantages and disadvantages. A text processing command cannot be completely replaced by another one, otherwise, there will be no three text processing commands. However, sed and awk are more
Brief introduction
Awk is a powerful text analysis tool that is particularly powerful when it comes to analyzing and generating reports on data, compared to grep lookup and sed editing. To put it simply, awk reads the file line by row, using a space as the default delimiter to slice each row, cut the section, and then perform various analytical processing.AWK has 3 different versions:
Tags: count expr while failed crack ifconf Linux text lock config
Awk is a programming language
For text processing and report generation
语法格式awk [option] ‘pattern{action}‘ fileawk [参数] ‘条件{动作}‘ 文件
parameter options for the awk command
-f Specifies the field delimiter
-V define or modify a variab
Source: http://blog.csdn.net/blackbillow/archive/2009/01/21/3847425.aspx
Awk processing text Summary-alex. Wang
As a technical support project, we often encounter the need to process text files. No matter what database can finally be imported into text, we can process it, in this way, you can process the data even if you are not familiar with all database operations.
We need two tools: shell and awk,
Linux awk command detailsIntroduction
Awk is a powerful text analysis tool. Compared with grep search and sed editing, awk is particularly powerful in data analysis and report generation. To put it simply, awk refers to reading files row by row. Each line is sliced with spaces as the default separator, and the cut part
Use awk to filter strings in text or files
When we use a specific command in Unix/Linux to read or edit text from a string or file, we often need to filter out the output to get the desired part. In this case, the regular expression will be used.What is a regular expression?
A regular expression can be defined as a string that represents several character sequences. One of its most important functions is that it allows you to filter the output of a co
Awk usage description awk: The Chinese meaning is that the Report Generator can format and display the information based on the information we enter, and the defined information is more beautiful (intuitive) the new awk (nawk) is implemented on windows, and gawk and awk are implemented on linux.
Introduction to Unix awk commands
The most basic function of the awk language is to browse and extract information based on specified rules in a file or string. Only after awk extracts information can other text operations be performed, A complete awk script is usually used to format information in a text file.
Call a
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.