ASIC/FPGA Design and Verification Out Source Services
Trim line to 80 or less characters in a text file.
This page is for sharing a perl script for line length control.
- Sometimes you receive a text file with extremely long lines. This makes the file not convenient to read. If a line contains spaces, it will be easier to read, if such a long line is broken on space limits to lines of maximum 80 characters.
- The script tries to have as much as characters as possible in a given text line with the above constraints.
- Should a line be greater than 80 characters and there are no spaces in it, it will not be broken.
- The script is written in perl. It uses perl index function rather than regexp to achieve better performance.
- The script is available at: perl script
|