changeset 2194:1115f4ff23c4

cgitest
author FUJIKAWA Kosuke <c111126@g.koeki-u.ac.jp>
date Thu, 06 Feb 2014 20:39:17 +0900
parents 67896a5ba5ad
children f34d766d3082
files nakamachi/hoge.dat nakamachi/plas.rb
diffstat 2 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/nakamachi/hoge.dat	Thu Feb 06 20:32:53 2014 +0900
+++ b/nakamachi/hoge.dat	Thu Feb 06 20:39:17 2014 +0900
@@ -1,5 +1,5 @@
-1	106996	4	¤Õ¤¸
-2	1165563	3	¤«¤ï
+1	106996	0	a
+2	1165563 0       a	
 3	1547608	0	a
 4	1637816	0	a
 5	1674821	0	a
--- a/nakamachi/plas.rb	Thu Feb 06 20:32:53 2014 +0900
+++ b/nakamachi/plas.rb	Thu Feb 06 20:39:17 2014 +0900
@@ -9,6 +9,17 @@
 math1 = cgi["math1"].to_i
 math2 = cgi["math2"].to_i
 
+open("hoge.dat","r") do |hoge|
+  while line = hoge.gets
+    line = line.toeuc
+    if /(\d+)\s+(\d+)\s+(\d+)\s+(\S+)/ =~ line
+      ban[n] = $1.to_i
+      data[$1.to_i] = $2.to_i,$3.to_i,$4
+      n += 1
+    end
+  end
+end
+
 printf(<<_EOS_,math1,math2,math1+math2)
 <html>
 <head>

yatex.org