Use velocity tips and velocity tips
Due to the company's needs, I used the velocity template for file generation. Here are some tips for using the velocity template:
1. when intercepting a string, note that (1) Use. length () is used to obtain the string length. (2) it is best to replace "-1" in the form of "+ (-1)", because velocity does not support minus, easy to confuse. 2. $ velocityCount (Cyclic traversal counter) We need to operate between strings (for example, adding a comma or other identical symbols) after character traversal, but the last character, we do not need to add it. In this case, we need to use $ velocityCount for operations. After traversing the string, use "," to separate the output, and the last one does not add ",". Note that $ velocityCount will automatically + 1 for each loop. Here fields. size () is the length of the set.