Skip to content

A simple program to cut a file into a specified number of columns, preserving whole words if possible.

Notifications You must be signed in to change notification settings

MarkTraceur/cols

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

cols -- take a file from the command line and cut it down to a specified number of columns, preserving whole words, then put it in the target file. Default 80 columns.

This program is licensed under the WTFPL, found at http://sam.zoy.org/wtfpl. I don't mean to be vulgar, but this best specifies my wishes for the code.

Original code written by Mark Holmquist at the University of Redlands in 2010.

Usage examples:
  cols file1 file2 -- cut file1 to 80 columns, put the result into file2.
  cols -c 50 file1 file2 -- cut file1 to 50 columns, put the result into file2.
  cols file1 -- cut file1 to 80 columns, and replace the contents of that file with the result.

Note: This program is not like cut(1). Cut will not preserve the contents of the line as new lines, but will simply remove parts of the line that exceed the specified column. This program is more useful if one needs a file to adhere to a specified width, but should still have all of the content.

About

A simple program to cut a file into a specified number of columns, preserving whole words if possible.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages