lib/textfile.rb
# Sorts file and removes any duplicate records.
Sorts file and removes any duplicate records.
Sorts file and removes any duplicate records .
def sort
    return self if sorted
    options = "--buffer-size=#{@bufsiz}" if @bufsiz
    with_tempcopy do |tempcopy|
      sh "#{sort_cmd} #{options} #{tempcopy} | #{uniq_cmd} > #{@path}"
    end
    @sorted = true
    self
  end
def sort return self if sorted options = "--buffer-size=#{@bufsiz}" if @bufsiz with_tempcopy do | tempcopy | sh "#{sort_cmd} #{options} #{tempcopy} | #{uniq_cmd} > #{@path}" end @sorted = true self end
Sorts file and removes any duplicate records.
Sorts file and removes any duplicate records .