请教:文件读取超多 2937 行就不读取的问题
代码如下:
f = File.open('TemplateInfo.xml','r') f.each_line do |line| puts line end
这是什么原因呢?我估计是 io 限制,求指点
会不会 2937 行有个 EOF 值?
文件拿出来看看?
" <string>libs/BeeFramework/MVC/View/Bee_UISegmentedControl.m</string>\n" " <string>libs/BeeFramework/MVC/View/Bee_UISignal.m</string>\n" " <string>libs/BeeFramework/MVC/View/Bee_UITabBar.m</string>\n" " <string>libs/BeeFramework/MVC/View/Bee_UITextField.m</string>\n" " <string>libs/BeeFramework/MVC/View/Bee_UITextView.m</string>\n" " <string>libs/BeeFramework/MVC/View/Bee_UITipsView.m</string>\n" " <string>libs/BeeFramework/MVC/View/Bee_UIWebView.m</string>\n" " <string>libs/BeeFramework/MVC/View/Bee_UIZoomView.m</string>\n" " <string>libs/BeeFramework/MVC/View/Bee_View.m</string>\n" " <string>libs/BeeFramework/MVC/View/Extension/CGRect+BeeExtension.m</string>\n" " <string>libs/BeeFramework/MVC/View/Extension/UIColor+BeeExtension.m</string>\n" " <string>libs/BeeFramework/MVC/View/Extension/UIFont+BeeExtension.m</string>\n" " <string>libs/BeeFramework/MVC/View/Extension/UIImage+BeeExtension.m</string>\n" " <string>libs/BeeFramework/MVC/View/Extension/UIView+BeeExtension.m</string>\n" " <string>libs/BeeFramework/MVC/View/Extension/UIView+BeeUISignal.m</string>\n" " <string>libs/BeeFramework/MVC/View/Extension/UIView+HoldGesture.m</string>\n" " <string>libs/BeeFramework/MVC/View/Extension/UIView+PanGesture.m</string>\n" " <string>libs/BeeFramework/MVC/View/Extension/UIView+SwipeGesture.m</string>\n" " <string>libs/BeeFramework/MVC/View/Extension/UIView+TapGesture.m</string"
到这里就结束了
f = File.open('TemplateInfo.xml','r') ; t = f.readlines t.each do |line| p line end
这个文件有点大,127k,2842 行
@jjym @iBachue
@i5ting 还是给文件吧。可以用 Dropbox 或者 github 传一下。