File: repfind-change.rb

package info (click to toggle)
genometools 1.6.1%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 50,412 kB
  • sloc: ansic: 271,241; ruby: 30,339; python: 4,880; sh: 3,193; makefile: 1,194; perl: 219; pascal: 159; haskell: 37; sed: 5
file content (21 lines) | stat: -rwxr-xr-x 447 bytes parent folder | download | duplicates (9)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/usr/bin/env ruby

if ARGV.length != 1
  STDERR.puts "Usage: #{$0} <inputfile>"
  exit 1
end

inputfile=ARGV[0]

File.open(inputfile).each_line do |line|
  a = line.split(/ /)
  if a.length == 3
    puts "#{a[0]} 0 #{a[1]} F #{a[0]} #{a[2]}"
  elsif a.length == 4
    puts "#{a[0]} 0 #{a[1]} F #{a[0]} #{a[2]} #{a[3]}"
  else
    STDERR.puts "#{$0} #{inputfile}: each line must consist of 3 " +
                "or 4 columns"
    exit
  end
end