sonson@Picture&Software - [Ruby] ファイルの一括処理

screenshot

ファイルの末尾はeofで確認できるので,1行ずつの読み込みは,以下のように行える. ファイルからの読み込みは,getsで行う. while !fr.eof str = fr.gets print str end 置換して書き込む 今回のプログラム全体は,こうなった. #!/usr/bin/ruby def eliminateChilda(fileName) readFilePath = "/Users/sonson/develop/Ruby/wiki/" + fileName writeFilePath = "/Users/sonson/develop/Ruby/wiki2/" + fileName fr = open(readFilePath,"r") fw = open(writeFileP...

http://son-son.sakura.ne.jp/programming/ruby_1.html
http://b.hatena.ne.jp/entry/http://son-son.sakura.ne.jp/programming/ruby_1.html