#!/usr/bin/perl
open FILE, '<', aa or die "./aa:$!";
open $cc,'>>', bb or die "./bb:$!";
while () {
s/(^\d.*)\n/\1\,/g;
s/^\s+//g;
s/\ +/\t/g;
print $cc "$_";
}
file.txt
10k 5 5 r1,r2,r3,r4,r5,r6,r7
r8,r9,10
1k 1 1 r11,r12,r13,r14,r15
r16,r17
outfile.txt
10k 5 5 r1,r2,r3,r4,r5,r6,r7,r8,r9,10
1k 1 1 r11,r12,r13,r14,r15,r16,r17
阅读(820) | 评论(0) | 转发(0) |