Mac Text Processing command sharingMac Text Processing command share table of Contents
1. Sed
1.1. Text Lookup Replacement
1.2. Text insertion
1.3. Text line deletion
1.4. Execute SED script
2. awk
Linux Text processing the Three Musketeers grep egrepGrep:global search REgular expression andprint out of the line.function: Text Search tool, according to user-specified "mode (pattern) "Go through the line to search for the target text and print
First, the regular expression 1, the type of the matching character
[A-z]: lowercase letters
[A-z]: uppercase
[A-Z]: small or uppercase
[0-9]: Number
[A-za-z0-9]: Represents a character that matches a letter or number
. :
I. Practice REQUIREMENTS: Write a simple text processing tool with three tasks, one to receive user input, one to format user input, and one to file formatted resultstwo. Analysis:Three tasks, that is, three threads. The input, conversion, and
One: Cause(1) The shift in attitudes and ideas is important: The reason for learning Python is also tortuous enough-to learn about Python and the Perl language, to learn about it, and to have the motivation to study it. Finally, learning about
Text Processing ToolsThere are a lot of text tools in the Linux system now specifically describes several tools and files such as extracting text Three MusketeersFile content: Less and catFile interception: Head and tailExtract by column: CutExtract
Text Processing tool grep, regular expressions in the Linux learning process is prone to confusion and obstacles in the place, here to share some of the experience of this content.
grep Global search REgular expression and Print out of the
Linux Seventh Day: (August 05) Text Processing toolHead-n Specify the first n rows of the right of shipmentTAIL-N Specifies to get the following n rowsTail-f displaying new additions to filesCut-d indicates delimiter, default tabCut-f the first few
I. Common Text Processing tool commandsCat command:Cat [OPTION] ... [FILE] ...-A,--show-all equivalent to-vet-b,--number-nonblank to non-null output line number-e equivalent to-VE-E,--show-end s shows $-n at the end of each line,--number to all
A), the three major text processing of Linux grep:grep (Global search REgular expression and print out of the line, fully search for regular expressions and print them out): After giving a list of files or standard output, grep searches for text
? Cat Viewing files0 There is no visible content: Cat-a file0 line number: Cat-n file blank line plus number0 line number: Cat-b file blank line is not numbered0 compressing adjacent empty lines: Cat-ns file0 Inverted display: TAC file? More/less0
sed( Stream editor), line editorssed [option]: ' Scrip ' InputfileScrip ' Address command 'Do not give address: the full text of the processingSingle Address:#: Specified line $: last row/pattern/: Each row that can be matched by this
Text Processing sed!!! Sed is a row editor for modifying the contents of a fileFunction: Used to process editing one or more filesOfficial website: http://www.gnu.org/software/sed/manual/sed.htmlBy default, SED reads the data read into the pattern
1. Description of the problemWhen using Python for text processing, sometimes the text contained in Chinese, English, Japanese, and other languages, sometimes can not be processed at the same time, it is necessary to determine the current text
Linux Text Processing ToolsSpecial permissions on 1.Linux file system: SUID SGID StickySecurity context for a process: (1) Any executable program file can be started as a process, depending on whether the initiator has permission to execute the
Text Processing Tools Grep,eprep and Fgrep:grep: (Global search regular expression and print out of the line), full search of regular expressions and display of corresponding rowsText Search Tool: line-by-line search of target files based on
Linux command line Text Processing tool file Browse Cat view file contentsMore view file contents as page flipping (page down only)Less view the contents of a file as a page turn (page up or down)Head view the beginning of the file 10 lines (or the
A), the three major text processing of Linux grep:grep (Global search REgular expression and print out of the line, fully search for regular expressions and print them out): After giving a list of files or standard output, grep searches for text
The Three Musketeers of text processing under LinuxThe first sword grep, Egrep, Fgrep: Text Search tool; Search operations on given text based on "pattern";The second Sword Sed:stream editor, stream editor, line editing tools, text editing
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.