如何将以下的空格替换成tab
2016-09-09
展开全部
use strict;
use v5.10;
while(<DATA>){
s/\s+/\t/g;
say $_;
}
__DATA__
freq rate txchain target temp meas pwr meas_EVM EVMLimit evmP/F delta 1.2dB 1.2dB 1.0dB
2412 11S 1 27.0 142 27.3 -31.0 -10.0 . 0.3 . . .
2412 6 1 27.0 142 27.1 -30.9 -5.0 . 0.1 . . .
2412 54 1 26.0 143 26.4 -32.8 -26.0 . 0.4 . . .
2412 t0 1 27.0 141 27.4 -29.7 -7.0 . 0.4 . . .
2412 t7 1 24.0 141 24.7 -35.3 -28.7 . 0.7 . . .
2437 11S 1 27.0 141 27.2 -29.3 -10.0 . 0.2 . . .
2437 6 1 27.0 141 27.3 -31.0 -5.0 . 0.3 . . .
2437 54 1 26.0 141 26.5 -31.6 -26.0 . 0.5 . . .
2437 t0 1 27.0 140 27.0 -30.2 -7.0 . 0.0 . . .
2437 t7 1 24.0 140 24.5 -35.9 -28.7 . 0.5 . . .
2462 11S 1 27.0 140 26.9 -29.7 -10.0 . -0.1 . . .
2462 6 1 27.0 141 26.7 -30.4 -5.0 . -0.3 . . .
2462 54 1 26.0 140 25.9 -31.9 -26.0 . -0.1 . . .
2462 t0 1 27.0 140 26.8 -30.0 -7.0 . -0.2 . . .
2462 t7 1 24.0 140 24.1 -34.8 -28.7 . 0.1 . . .
use v5.10;
while(<DATA>){
s/\s+/\t/g;
say $_;
}
__DATA__
freq rate txchain target temp meas pwr meas_EVM EVMLimit evmP/F delta 1.2dB 1.2dB 1.0dB
2412 11S 1 27.0 142 27.3 -31.0 -10.0 . 0.3 . . .
2412 6 1 27.0 142 27.1 -30.9 -5.0 . 0.1 . . .
2412 54 1 26.0 143 26.4 -32.8 -26.0 . 0.4 . . .
2412 t0 1 27.0 141 27.4 -29.7 -7.0 . 0.4 . . .
2412 t7 1 24.0 141 24.7 -35.3 -28.7 . 0.7 . . .
2437 11S 1 27.0 141 27.2 -29.3 -10.0 . 0.2 . . .
2437 6 1 27.0 141 27.3 -31.0 -5.0 . 0.3 . . .
2437 54 1 26.0 141 26.5 -31.6 -26.0 . 0.5 . . .
2437 t0 1 27.0 140 27.0 -30.2 -7.0 . 0.0 . . .
2437 t7 1 24.0 140 24.5 -35.9 -28.7 . 0.5 . . .
2462 11S 1 27.0 140 26.9 -29.7 -10.0 . -0.1 . . .
2462 6 1 27.0 141 26.7 -30.4 -5.0 . -0.3 . . .
2462 54 1 26.0 140 25.9 -31.9 -26.0 . -0.1 . . .
2462 t0 1 27.0 140 26.8 -30.0 -7.0 . -0.2 . . .
2462 t7 1 24.0 140 24.1 -34.8 -28.7 . 0.1 . . .
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |