Subversion Repositories Projects

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
206 ligi 1
require 'rio'
2
 
3
plain_str=""
4
rio(ARGV[0]).read.each_line {|l|
5
#  plain_str << l[11..-3].delete("\n\r")
6
 
7
puts l
8
l.delete!("\n\r")
9
plain_str<< l[9,(l.length-11)]
10
puts ">"+ l[9,(l.length-11)]
11
}
12
 
13
 
14
puts plain_str.length/2.0
15
 
16
#return
17
new = []
18
(plain_str.length/2).times {|i|
19
  new << (plain_str[(i*2)..(i*2+1)].to_i(16))
20
}
21
 
22
 
23
foo=rio(ARGV[1])
24
foo.write( ((new.length >> 24 )&0xff).chr)
25
foo.write( ((new.length >> 16 )&0xff).chr)
26
foo.write( ((new.length >> 8 )&0xff).chr)
27
foo.write( ((new.length&0xff)).chr)
28
new.each { |c|
29
  foo.write( c.chr)
30
}
31
 
32
puts new.length
33
 
34
 
35