Objective:The processing of logs in the server is a very common work, so operation and maintenance for a variety of text tools to view, analyze, statistics, is a necessary basic work. It is necessary to learn common file handling commands such as
one, thecat command1, optional parameters-A,--show-all equivalent to -vet-B,--number-nonblank number of non-null output lines-e equivalent to -ve-E,--show-ends displays at the end of each line-N,--number all line numbers for the
I. Background of the problemProduction environment: Oracle database, hibernate operation defines a table
CREATE TABLE Store_information (ID CHAR () not NULL, name VARCHAR2 (254) Default ", Conte NT CLOB default ', create_time VARCHAR2 default ',
One: Linux Text Processing tool
?: Extracting text from a tool?: File contents: Less and CatCat-E: Display line terminator $-N: Numbering each line displayed-A: Show all control characters-B: Non-empty line number-S: Compress consecutive blank
Pattern Matching FunctionThe most powerful functions in the string library are:String. Find (string SEARCH)String. gsub (Replacement of global strings)String. gfind (Global string SEARCH)String. gmatch (returns the iterator that finds the
August 4, the main learning contents are as follows:First, the tool of extracting text: Less,cat,head,tail,cutII. Tools for analyzing text: Wc,sort,diff,patchSecond, grep and regular expressionsThird, Egrep extended regular expression
I. Tools
Linux has a lot of text processing tools, this article will introduce several more commonly used text processing tools, such as text viewing tools: Cat and less, text Capture tool: Head and tail, extract text by column tool: Cut, query Text tool by
Today, you need to write a small tool to parse CSV data to Lua, which uses the string in the Lua library. gsub () has never been very familiar with this method. Today, I finally tried it well. It is very powerful, enjoyable, and convenient...
The
How Linux displays a few lines of a file (in the middle of a few lines)"One" starts at line No. 3000 and displays 1000 rows. The 3000~3999 line is displayedCat FileName | Tail-n +3000 | Head-n 1000"Two" displays 1000 rows to 3000 rowsCat FileName |
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.