1. Uniq commandUniq-report or omit repeated linesDescription: Uniq A unique check of the specified ASCII file or standard input to determine which rows are repeated in the text file. Often used for system troubleshooting and log analysisCommand format:Uniq [OPTION] ... [File1 [File2]]Uniq removes duplicate lines from the sorted
I, ref FileInfo J)
{
FileInfo T;
t = i;
i = j;
j = t;
}
Fast sorting algorithm
Fast sort for unstable sort, time complexity O (nlog2n), the fastest sorting method in the same order of magnitude
public static void QuickSort (fileinfo[] arr, int low, int high)
{
if (low {
int pivot = Partition (arr, low, high);
QuickSort (arr, Low, pivot-1);
QuickSort (arr, pivot + 1, high);
}
}
}
For other sorting algorit
To be improved... sort: it is very efficient and powerful to implement the text sorting algorithm. the content of the original file is not modified. only the content output on the screen is modified. for example, sort/etc/fstab #-u removes duplicate rows. #-n sort by numeric
In PHP programming, if you use a text database, you may have a headache for sorting problems. The following sunny little describes how to use PHP to combine JavaScript scripts to implement this functionality: The following figure, when the user clicks on the corresponding heading category, if the category is different from the original category, according to the corresponding category of the same ascending and descending order; When the click category
third section, the colleague separator is ":"[Email protected] test]# cut-d:-F 1,3/etc/passwd--output-delimiter= #root #0bin#1daemon#2adm#3.2. View the last line of the/etc/passwd file, and intercept the tenth character starting at the 5th character.[Email protected] test]# TAIL-1/etc/passwd | Cut-c 5-10:4326:Sort sortSort-sort lines of
Text Processing commands:Cut ,sort ,WC ,uniqCut Select a paragraph in a piece of information, and the information is processed in "Rows". syntax:cut OPTION ... [FILE] ...Parameters:–d ' separators '–f # Segmentation by character, showing section # #, #,#: 1,3,5 shows the information ofparagraph 1, 3, and5#-#:2-4 Display The information in paragraphs 2 throug
#include Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.Write a void sort (int*x,int N) Implementation to sort the n data in the X array from large to small. N and array elements are entered in the main function. Display the results on the screen and output to a file
to the high end}Arr [low] = middle; // The center axis is moved to the correct position.Return low; // return the center axis position}Static void Swap (ref FileInfo I, ref FileInfo j){FileInfo t;T = I;I = j;J = t;}/// /// Quick Sorting Algorithm/// /// The fast sorting method is unstable, and the time complexity is O (nlog2n), which is the fastest sorting method of the same order of magnitude./// /// /// Public static void QuickSort (FileInfo [] arr, int low, int high){If (low {Int Partition =
Cut: Intercepting text-specific fieldsNAMECut-remove sections from all line of files-D,--delimiter=delim (Specify field delimiter, default is space)Use DELIM instead of the TAB for field delimiter-F,--fields=list (Specifies the field to display)Select only these fields; Also print any line that contains no delimiter character,Unless the-s option is specified-F 1,3-F 1-3[Email protected] ~]$ CAT/ETC/PASSWDRoot:x:0:0:root:/root:/bin/bashBin:x:1:1:bin:/b
Content directory: Find file lookup grep text Search xargs command line parameter conversion sort sort Uniq eliminate duplicate rows with TR convert cut by column split text paste by column stitching text WC statistic lines and ch
example head-4/etc/passwd |sort-t Specifies the delimiter,-K specifies the areaFor example head-4/etc/passwd |sort-t ': '-k3-nYou can also sort on a contiguous areaFor example head-4/etc/passwd |sort-t ': '-k3,5-r3 Command WCThe number of lines, characters, or words used to count the document-L count rows-M statistic
Disclaimer: The following is only the common options for commands, if you need to learn more about the details of the command, you need to refer to other information.First, cutCut is a selection command that analyzes a piece of data and takes out what we want. In general, the selection of information is usually for "line" to analyze, not the entire information analysis.-D: Custom delimiter, the default delimiter is a tab.-F: Specify which area to displayExample:(my_python_env) [Email protected]
Java Algorithm interview questions: Read all names from text files similar to the following, print duplicate names and repeated times, and sort by repeated times; read docx and read doc. Use the poi jar package to provide download,
Read all names from text files similar to the following, print duplicate names and repeated times, and
matching Fuyar rows, pattern matching methodSed–n ' 2,/fuyar/p ' myfile from the second line to the end of the match to the Fuyar. The combination of line number mode and pattern matching method=: Print the current line number.Sed–n '/^$/= ' myfile display blank line numberSed–n–e '/^$/= ' –e '/^$/p ' myfile displays a blank line number and printsSed-n ' s/param/ hellow/p ' yy.sh added param after hellowSed-n ' S/param/hellow /p ' yy.sh at Param before adding hellow
6.
Sort out grep practical text search and filtering skills
I. Introduction to grep:
The text search tool performs a row-by-row search on the target file based on the text mode specified by the user to display the rows that can be matched by the mode. The use of regular express
sort [-fbmnrtuk] [file or stdin] options and Parameters:-F : Ignores case differences, for example A and a are treated as encodings;-b : Ignores the first whitespace part;-M : Sort by the name of the month, such as the sort method of JAN, DEC and so on;-N: Sort using "pure
Text processing cat more less head tail sort uniq grep cut jion sed awk################################################cat:concatenate files and print on the standard output display the contents of the file to the normal outputs (display)-E: Displays the last character at the end-N: Show line numbering[Email protected] ~]# cat-n/etc/shells1/bin/sh2/bin/bash3/sbin
Does php save text articles in the text field or generate an html file or other methods? Please have a practical solution? I am using ueditor? Request an article to explain the solution in detail ------ solution ---------------------- whether html is generated or not, you must first save the content in the data preview. You need to search for the keyword. Does ph
files that include W and tGrep-e "W*t" fileFind rows greater than 560 less than 893 in file filesGrep-e "[5-8][6-9][0-3]"Find a row with two 9 in a fileGrep-e "9{2}" fileFind rows that are larger than two 9Grep-e "9{2,}" fileFinding blank lines in a fileGrep-e "^$" fileFind included? The linegrep "?" FileFind lines in a file that start with WGrep-e "^w" fileFind rows in 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.