logo       

contribution scripts/Strip-White-Spaces: msg#00040

t2.devel

Subject: contribution scripts/Strip-White-Spaces


This is a multi-part message in MIME format.a tiny and handy script to strip whitespaces. a quick hack :-)
#!/usr/bin/ruby

a=File.new(ARGV[0],'r')
b=Array.new

while c=a.gets
b[b.size]=c.strip
end

a.close

a=File.new(ARGV[0],File::TRUNC|File::WRONLY)

b.each{|e|
a.puts b
}

a.close


<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise