由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Unix版 - A Perl Question
相关主题
[转载] help: list private and global variables in perlRe: how to use a variable to represent interger which is bigger than 3
how to automatically send email with attachments in Perl?CGI之Perl Script一问
Remove core.xxxx files?how to let awk not print?
Re: 请推荐一本perl book好不好how to write robort in perl w/out expect?
好马配好鞍/介绍一套linux牛书/O'Reilly Animal Book[转载] How to remove an Environment variable on Solaris
DD weijing!How to do "which" in perl?
shell programminghow to run active perl in cygwin?
how to use a variable to represent interger which is bigger than 32768?[转载] Perl 土问题
相关话题的讨论汇总
话题: perl话题: variable话题: question话题: next
进入Unix版参与讨论
1 (共1页)
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})/
1 (共1页)
进入Unix版参与讨论
相关主题
[转载] Perl 土问题好马配好鞍/介绍一套linux牛书/O'Reilly Animal Book
[转载] Perl高手请进DD weijing!
equivilent $REMOTEHOST in kshshell programming
[转载] QUestion about Perlhow to use a variable to represent interger which is bigger than 32768?
[转载] help: list private and global variables in perlRe: how to use a variable to represent interger which is bigger than 3
how to automatically send email with attachments in Perl?CGI之Perl Script一问
Remove core.xxxx files?how to let awk not print?
Re: 请推荐一本perl book好不好how to write robort in perl w/out expect?
相关话题的讨论汇总
话题: perl话题: variable话题: question话题: next