看板 [ Perl ]
討論串[問題] 一個關於perl讀檔的問題 請各位高手幫忙!
共 4 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者pziyout (pziyout)時間17年前 (2008/05/02 11:06), 編輯資訊
0
0
0
內容預覽:
open(A,"file.txt") ;. open(B,"> data.txt") ;. /\d/ ? push( @d , split ) : push( @a , split ) for <A> ;. print B "$a[$_] $d[$_] " for 0 .. $#a ;. --.

推噓1(1推 0噓 1→)留言2則,0人參與, 最新作者pqman (who want some?)時間17年前 (2008/05/01 21:45), 編輯資訊
0
0
0
內容預覽:
現在我卡在一個地方. 那就是我想用常規表示法來搜尋字串. 以下是我的code 例如我想找到a 把他貼到data.txt上. open (data1,"file.txt"). $text=<data1>;. while ($text){. if ($a = $text =~/\ba\b/){. $a=
(還有230個字)

推噓1(1推 0噓 0→)留言1則,0人參與, 最新作者LiloHuang (相見不如懷念)時間17年前 (2008/05/01 00:19), 編輯資訊
0
0
0
內容預覽:
#!/usr/bin/perl. $input = qq~a b c d e. f g h i j. 1 2 3 4 5. 6 7 8 9 10~;. my @array = map{\@{[split/\s+/]}} split/$\//,$input;. for my $i(0..$#array

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者pqman (who want some?)時間17年前 (2008/04/30 23:17), 編輯資訊
0
0
0
內容預覽:
想請問大家. 現在我有一個檔案 file.txt. 內容是. a b c d e. f g h i j. 1 2 3 4 5. 6 7 8 9 10. 我想把這群資料重新排列成. a 1 b 2 c 3 d 4 e 5 f 6 g 7 h 8 i 9 j 10. 然後輸出到data.txt. 請問我
首頁
上一頁
1
下一頁
尾頁