complete.: Set Wrapscan re-search, when searching to the head or end of the file, return to continue the search, by default open.Replace commandThe RA replaces the current character with a, when the period character is the character of the cursor.s/old/new/replace new with old, replacing the first match of the current rows/old/new/g replace new with old, replacing all occurrences of the current row%s/old/new/replace new with old, replacing the first match of all rows%s/old/new/g replace new wit
specified by the file name Filename.txt.: W, then enter (enter: W, then enter, save the file without exiting): Wq, then enter (enter: Wq, then enter, save and exit): q!, and then enter (enter: q!, and then enter, do not save the mandatory exit VI): e!, discard all changes, and open the original fileMoveHJKL, control the cursor to the left, bottom, top, and right one grid, or you can use four arrowsThe above four commands can be used with the number, such as 20J is to move down 20 lines, 5h is t
10x, after the current position after inserting 3! , 3a! W moves forward one word (the cursor stops at the beginning of the word), and if it is at the end of the line, go to the start of the next line. This command is fast and can replace the L command.b Move backward one word 2b move backwards 2 wordsE, with W, except that the cursor stops at the tail of the word.GE, with B, the cursor stops at the end of the word.^ Moves to the first non-whitespace
delete 10 characters 10x, after the current position after inserting 3! , 3a! W moves forward one word (the cursor stops at the beginning of the word), and if it is at the end of the line, go to the start of the next line. This command is fast and can replace the L command.b Move backward one word 2b move backwards 2 wordsE, with W, except that the cursor stops at the tail of the word.GE, with B, the cursor stops at the end of the word.^ Moves to the
last line and replace the string with Word2! ( Common)
: 1, $s/word1/word2/gc
Look for the word1 string from the first line to the last line and replace the string with Word2! and display the prompt character before the substitution to the user to confirm (confirm) whether need to replace! ( Common)
8. Deleting strings and rows
X, X
In one line of words, X is the backward deletion of a character (equivalent to the [Del] key), and X is to delet
Transferred from: http://blog.csdn.net/lhf_tiger/article/details/8203013It's disgusting, the 10X process generated by the CSV file row bit actually has ^m characters, harm I have been looking for the cause of the error, really pit, fortunately, I finally found out. have been using Python,perl is becoming more and more unskilled. Commissioning took a long time.Replace ^m charactersUse VI under Linux to see some text files created under Windows, and som
characters consecutively, "10x".
Dd
Delete the entire column where the cursor is located ( Common)
Ndd
N is a number. Delete the down n column where the cursor is located, for example, 20DD to delete 20 columns ( common)
d1g
Remove all data from the first row of the cursor
Dg
Delete all data from the last row of the cursor
d$
Delete the last character of th
In this section, we will learn about Python's control flow statements, mainly including if, for, while, break, continue, and pass statements
1. If statement
The IF statement is perhaps the most familiar statement we have. Here's how to use it:
X=input ("Please input an integer:")If xprint ' xElif x==0:print ' x=0 'Elif x>0:print ' x>0 'Elseprint ' x is not a number 'Operation Result:>>>Please input an integer:10X>0
2.f
, many commands can be used with the number, such as delete 10 characters 10x, after the current position after inserting 3! , 3a! W moves forward one word (the cursor stops at the beginning of the word), and if it is at the end of the line, go to the start of the next line. This command is fast and can replace the L command.b Move backward one word 2b move backwards 2 wordsE, with W, except that the cursor stops at the tail of the word.GE, with B, th
Defined:
#define EXAMPLE (x) printf ("x =%d", x)
i = 10; j = 11;EXAMPLE (i)EXAMPLE (j)i = 20; j = 21;EXAMPLE (i)EXAMPLE (j)
Output:
x = 10x = 11x = 20x = 21
This output is not the effect we want.Modifies the use of printf in a macro definition.
#define EXAMPLE (x) printf (#x "=%d", x)
Output:
i = 10j = 11i = 20j = 21
# awk ' Condition 1{action 1} Condition 2{action 2} ... ' File namecondition (Pattern):Generally use relational expressions as conditions x > 10 to determine if a variable x is greater than 10x>=10 greater than or equal to xactions (Action):Formatting output Flow control statementstext message: Vim score.txt
1234
ID Name PHP Linux MySQL Average1 Liming 82 95 86 87.662 Sc 74 96 87 85.663 Gao 99 83 93 91.66
1. Output scor
commands can be used with the number, such as delete 10 characters 10x, after the current position after inserting 3! , 3a! W moves forward one word (the cursor stops at the beginning of the word), and if it is at the end of the line, go to the start of the next line. This command is fast and can replace the L command.b Move backward one word 2b move backwards 2 wordsE, with W, except that the cursor stops at the tail of the word.GE, with B, the curs
, Evaluation-3 5System.out.println ( -3 5);//-38, do not introduce a 3rd value or variable, Exchange 2 data valuesint x = 10;int y = 5;x = x ^ y; 10 ^ 5y = x ^ y; Ten ^ 5 ^ 5 y = 10x = x ^ y; Ten ^ 5 ^ ten x = 5System.out.println ("x =" + x + ", y =" + y ");9, the most efficient calculation of 2 of the 3-time SquareSystem.out.println (2Shift a number to the left N-bit, which is equivalent to multiplying by 2 of the N-squar
. ' is a space that fills a space on the left side of a positive number to align with a negative number. 0 means using 0 padding.Width indicates display widthsPrecision indicates the precision after the decimal pointLike what:Print ("%+10x") print ("%04d"% 5) print ("%6.3f"% 2.3)The width above, precision is two integers. We can use * to dynamically substitute these two quantities. Like what:Print ("%.*f"% (4, 1.2))Python actually replaces * with 4来.
Label:BULK INSERT http://blog.csdn.net/xiaoxian8023/article/details/20155429 Mysql JDBC Batch data, need to add rewritebatchedstatements=true to JDBC connection. The default JDBC is not to turn on batch processing. Example: Jdbc:mysql://10.250.4.98:3306/dbname rewritebatchedstatements=true Java Updatebatchsample: Official Website Forums 39,260053,263456#msg-263456 MySQL itself have no real "batch" API for prepared statements.If You add the configuration property "Rewritebatchedstatements=true"
of variable itself is called Dynamic language, which corresponds to static language. Static languages must specify the variable type when defining the variable, and if the type does not match, an error is given. For example, Java is a static language, and assignment statements are as follows (//for comments):int a = 123; // a是整数类型变量a = "ABC"; // 错误:不能把字符串赋给整型变量This is why dynamic languages are more flexible than static languages.Do not equate an equal sign of an assignment statement with a math
type of variable itself is called Dynamic language, which corresponds to static language. Static languages must specify the variable type when defining the variable, and if the type does not match, an error is given. For example, Java is a static language, and assignment statements are as follows (//for comments):int a = 123; // a是整数类型变量a = "ABC"; // 错误:不能把字符串赋给整型变量This is why dynamic languages are more flexible than static languages.Do not equate an equal sign of an assignment statement with a
complete.: Set Wrapscan re-search, when searching to the head or end of the file, return to continue the search, by default open.Replace commandThe RA replaces the current character with a, when the period character is the character of the cursor.s/old/new/replace new with old, replacing the first match of the current rows/old/new/g replace new with old, replacing all occurrences of the current row%s/old/new/replace new with old, replacing the first match of all rows%s/old/new/g replace new wit
One, vim repeat command 1. Repeat the last commandIn normal mode . (decimal point) means the last command operation is repeatedCopy test files to a local directory$ cp /etc/protocols .Open a file for editing$ vim protocolsNormal mode input x , delete the first character, the input . (decimal point) will be deleted again a character, in addition to also can be repeated dd delete operation2. Execute commands of the same number of timesEnter Normal mode input N , n indicates the number of repetitio
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.