home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Power-Programmierung
/
CD1.mdf
/
magazine
/
cmplangm
/
1989_6
/
awk
/
fmt.awk
< prev
next >
Wrap
Text File
|
1988-03-01
|
426b
|
21 lines
# fmt - format
# input: text
# output: text formatted into lines of <= 60 characters
/./ { for (i = 1; i <= NF; i++) addword($i) }
/^$/ { printline(); print "" }
END { printline() }
function addword(w) {
if (length(line) + length(w) > 60)
printline()
line = line " " w
}
function printline() {
if (length(line) > 0) {
print substr(line, 2)
line = ""
}
}