Getting a text file rid of all superfluous blank lines

Mike McCarty mike.mccarty at sbcglobal.net
Fri Dec 2 20:06:23 UTC 2005


James Wilkinson wrote:
> Paul Smith wrote:
> 
>>So many ways of solving my problem show that this list is quite creative!
> 
> 
> Actually, it shows something more fundamental. It shows (one reason) why
> Unix is so powerful.

[snip]

Except that none of the "solutions" actually did what he wanted.
I'm not a scripting expert, but I suspect that a script could
be developed to do what he wants. I sent him source for a
C program which I believe does exactly what he wants.

Limitation: No line over 1022 characters in length (plus a newline
for 1023 if you count that).

Paul: If you have input lines longer than 1022 characters (not
counting the newline at the end) then you'll have to modify
that program. There is a line there

#define LINE_SIZE 1024

Change the number 1024 to be (longest_length_I_need + 2).
So, for examle, if you need 2176 characters in your longest
line, you would make the number at least 2178. Larger is
ok. Make it huge and the program will grow to be rather large,
so don't make it millions of bytes, ok? If you really need
*very* long lines, then I can help you there, too.

Mike
-- 
p="p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
This message made from 100% recycled bits.
You have found the bank of Larn.
I can explain it for you, but I can't understand it for you.
I speak only for myself, and I am unanimous in that!




More information about the fedora-list mailing list