c**o 发帖数: 166 | 1 Suppose I have text file like this:
sdfsdfsfsdf
sfdssdfdsfs
dddddd dddd
sdfsdfsasda
adsdddddddd
aa12345aaaa
aaaaaaaabbb
dddffffffff
If I want to put, say, the first 3 letters in one variable, next two in
another variable, next six in the third variable, of course, for each line,
how can I do that in perl?
Thanks, | c*r 发帖数: 278 | 2 substr
【在 c**o 的大作中提到】 : Suppose I have text file like this: : sdfsdfsfsdf : sfdssdfdsfs : dddddd dddd : sdfsdfsasda : adsdddddddd : aa12345aaaa : aaaaaaaabbb : dddffffffff : If I want to put, say, the first 3 letters in one variable, next two in
| A*****o 发帖数: 222 | 3 /(.{3})(.{2})(.{4})/
【在 c**o 的大作中提到】 : Suppose I have text file like this: : sdfsdfsfsdf : sfdssdfdsfs : dddddd dddd : sdfsdfsasda : adsdddddddd : aa12345aaaa : aaaaaaaabbb : dddffffffff : If I want to put, say, the first 3 letters in one variable, next two in
| c**o 发帖数: 166 | 4 Thanks, this one works and is simply.
line,
【在 A*****o 的大作中提到】 : /(.{3})(.{2})(.{4})/
|
|