看板 [ Perl ]
討論串[請益] 文字檔案中插入新文字.....
共 2 篇文章
首頁
上一頁
1
下一頁
尾頁

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者cutecpu (可愛中央處理器)時間19年前 (2006/05/31 17:09), 編輯資訊
0
0
0
內容預覽:
#!/usr/bin/perl. open FILE,"test.txt";. $s=<FILE>."ABCABC\n";. $s.=$_ while(<FILE>);. close FILE;. open FILE,">test.txt";. print FILE $s;. close FILE;

推噓0(0推 0噓 0→)留言0則,0人參與, 最新作者jacklinxp (開始工作)時間19年前 (2006/05/31 16:52), 編輯資訊
0
0
0
內容預覽:
有一個文字檔假設內容為. AAAAAA. DFDFDSF. BSDFDSF. BSDFSD. 如果我要在AAAAAA. 後面新增文字的話,要如何去開檔或者寫入呢?. 因為如果我用. open FILE, ">> text.txt";. 並在程式中使用print FILE, "ABCABC\n". 結
(還有42個字)
首頁
上一頁
1
下一頁
尾頁