From: Junhui Liao Date: 2010-07-26T07:15:25+09:00 Subject: Re: re-organize original text data then write in files > (I couldn't think of an easy way to what I think you want to do without > reading in all the data first, modifying it, then writing it out. That, > or > open 4096 files at the same time: neither way seems elegant.) Actually, I developed two versions of C++ script. One is opening 4096 files at the same time. This cost 3 hours. Another version is saving all of the data in a big vector, then scanning the vector to pick the right items to write in files. This cost 2 hours and 45 minutes. :-). > > Personally, if I didn't have much time, and I wanted to try something > out in > another computer language, I'd go with a language that I knew a little > about, so in my case that would be Ruby, Pascal, Qbasic (!!!), and - in > your > case - maybe try something quick in Python. (But I'd also encourage you > to > look at Ruby sometime and try it.) Thanks a lot for your encourage, I tried to read something on ruby already. Since this language is very simple and beautiful, no matter it works for my case or not(But I hope it could be). > > Maybe it partly depends on what standard methods/functions are > available: > for example, in Ruby you can read a line from a file into a String, and > then > use a builtin method on the String to split it into an array of values > using > a specified delimiter, so in your case a space character? I need this kind of comment seriously, saying, what are the knowledge which is necessary and enough to do my job. If there are some special and powerful methods or stances to do this kind of stuff. Or be better, give a example just very close my case. I can get the detailed by reading book(s) or googling. Anyway, thanks a lot for your reply! Best ! Junhui -- Posted via http://www.ruby-forum.com/.