| [ CnUnix ] in KIDS 글 쓴 이(By): Zaharang (vision2002) 날 짜 (Date): 2003년 2월 12일 수요일 오후 01시 27분 13초 제 목(Title): Re: [Q] 울트라 에디트에서...행 나누기.. 한 줄에 있는 data의 값이 엉망진창일 때의 script. perl언급을 했으니 책임지는 심정으로... -_-;; #!/usr/local/bin/perl $fname = $ARGV[0]; print "openning file..[".$fname."]\nZaharang Manse!!!!!\n"; open( openFd, $fname) or die "Fatal Error : File Open\n"; open ( openFD , $fname) ; $counter = 0; while ( $aLine = <openFD> ) { #chop($aLine); @tmp = split /,/, $aLine; for ( $i = 0 ; $i < $#tmp; $i++ ) { if ( $counter == 0 ) { print "{";} print $tmp[$i]; $counter++; if ( $counter > 15 ) { print "},\n"; $counter = 0; } else { print ",";} } } |