Linux text processing tool sort and uniq instance details
Linux text processing tool sort and uniq instance details
Sort: Sorts input rows by key value field, data type option, and locate
Syntax: sort [option] [file (s)]
Main options:
-B. Ignore the
PHP fgetcsv definition and usage
The PHP fgetcsv () function reads a row from the file pointer and parses the CSV field.Similar to PHP fgets (), the difference is that PHP fgetcsv () parses the rows read, finds fields in CSV format, and returns an
AWK-is a programming language tool used to process text.Original Meaning: Aho, Weinberger, KernighanDefinition: three creators, Aho, Weinberger, and Kernighan
AWK is similar to the shell programming language in many aspects, although AWK has its own
LinuxAWK command usageAwk usage: awk 'pattern' {action }'Variable name meaningNumber of ARGC command line VariablesARGV command line meta ArrayFILENAME current input file nameNumber of records in the current FNR FileThe input field delimiter of FS.
Linux Shell script programming learning notes and practice, Script Programming learning notes
Http://www.1987.name/141.html
Shell Basics
Terminal printing, arithmetic operations, common variables
Search for specific strings in a specified
Using Hadoop to analyze and process data requires loading the data into a cluster and combining it with other data in the enterprise production database. It is a challenge to load large chunks of data from production systems into Hadoop or to get
In the recent process of processing data with the shell, it was found that the read command would replace \ t with a space when reading the data, and \ t discard at the end of the line. Look at the help of Read, find-R can retain the escape
Use the BCP and bulk into commands (to be updated)
Use the BCP and bulk into commands (to be updated)
The BCP command is a practical data export and import tool in sql2005. We can use this command to conveniently import data everywhere.
First,
Statement for creating a table:Create [External] Table [if not exists] table_name[(Col_name data_type [comment col_comment],...)][Comment table_comment][Partitioned by (col_name data_type [comment col_comment],...)][Clustered by (col_name, col_name,.
Variable name meaningNumber of argc command line VariablesArgv command line meta ArrayFilename current input file nameFNR record number in the current fileThe input field delimiter of FS. The default Delimiter is a space.RS input record
1. Regular Expression
(1) Regular Expressions are generally used to describe the special usage of the text mode. common characters (such as a-z) and special characters (such as metacharacters, such as/, *, and /,*,? .(2) Basic metacharacters and
The code is as follows:Copy code Function get_csv_contents ($ file_target ){$ Handle = fopen ($ file_target, 'r ');While ($ data = fgetcsv ($ handle, 1000 ,",")){ $ Num = count ($ data );Echo " $ num fields in line $ row: ";$ Row ++;For ($ c =
Where is awk holy?
In short, awk is a programming language tool used to process text. The language of the awk utility is similar to the shell programming language in many ways, although awk has its own syntax. When awk was initially created, it was
How to merge multiple log files?The following uses the standard CLF format log (APACHE) as an example:The log format of Apche is as follows:% H % L % u % t/"% R/" %> S % BExample:111.222.111.222--[03/APR/2002: 10: 30: 17 + 0800] "Get/index.html HTTP/
1. In-depth discussion (awk, 1.1. In-depth discussion of awkRecords and fields, patterns and actions, regular expressions and meta-charactersThe basic tutorial has introducedConditional and logical operators>= greater than or equal to= = equals! =
I. Text-VIEWING commands1.cat command--View text file contents, multiple parameters connected and display multiple file contentsOptions:-N: Numbering each line when displayed (numbers do not belong to the original file contents)-E: Displays the
Awk is a powerful text analysis tool that reads the file line-by-row, using spaces as the default delimiter to slice each row, and then perform various analytical processing of the cut.awk command form:awk [-F |-f |-v] ' begin{}//{command1;command2;
1, check the file under a certain path.Search for "*.log" files under/etcFind/etc-name "*.log"2, expand, List all files under a path, including subdirectories.Find/etc-name "*"3. Look for all files that contain the "Hello Abcserver" string under a
Common basic usage features of Find grep sed awk under LINUXJust to make yourself a higher standard, this is the beginning of a 6-month small white advanced road!Learning Linux Basic commands these days is a bit of a crime, especially for files
Command:(1) File system relatedDirectory ManagementFile ManagementFile ViewFile editing(2) System Management relatedDirectory-related commands:Current directory or working directoryHome directory: HomeRoot:/rootNormal User:/home/username~: User's
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.