perl
no Path grade cha FMI Utterances
002 App-C1\Files\student\stu001 001 00 a _optmistic_ me NO
003 App-C1\Files\student\stu002 002 00 a _NOISE_ rt _SE_
004 App-C1\Files\student\stu002 002 00 a optmistic _SE_
001 App-C1\Files\student\stu002 002 00 a s CON EL ZO _SE
重组上面的文件,使其输出格式为App-C1\Files\student\stu001\001.no _optmistic_ me NO,然后在屏幕输出,怎么实现啊,急啊
[解决办法]
#!/usr/bin/env perluse strict;use warnings;while (<DATA>) { my @d = split /\s+/; print "$d[1]\\$d[2].no @d[5..$#d]\n";}__DATA__002 App-C1\Files\student\stu001 001 00 a _optmistic_ me NO003 App-C1\Files\student\stu002 002 00 a _NOISE_ rt _SE_004 App-C1\Files\student\stu002 002 00 a optmistic _SE_001 App-C1\Files\student\stu002 002 00 a s CON EL ZO _SE
[解决办法]
print "$d[1]\\$d[2].no @d[5..$#d]\n";