作者HZYSoft (PCMan 2004)
看板EZsoft
標題Re: [問題] 有沒有將文章倒序過來的軟體?
時間Fri Apr 6 01:46:01 2007
VBScript 又來了,請善用 Windows 系統內建功能
將以下程式碼貼入記事本,儲存檔案,檔案類型選 所有檔案
檔名輸入 article_rev.vbs 存檔即可
---------------------------------------------------------------------
fn = WScript.Arguments(0)
Set fs = CreateObject("Scripting.FileSystemObject")
Set f = fs.OpenTextFile( fn )
Do While Not f.AtEndOfStream
If s <> Empty Then s = Chr(13) + Chr(10) + s
s = f.ReadLine() + s
Loop
f.Close()
Set f = fs.CreateTextFile( fn + "_reverse.txt" )
f.Write( s )
f.Close()
---------------------------------------------------------------------
將你要反轉的文字檔拖曳,拉到 article_rev.vbs 的圖示上,放開
然後你就會看到在同資料夾下有個輸出檔案
檔名和原本的一樣,只是後面多了_reverse
--
個人網頁:
http://pcman.sayya.org/ 上面有自畫像及各種聯絡資訊
PCMan 全系列 BBS 連線軟體
http://pcman.ptt.cc/ http://pcmanx.csie.net/
新酷音輸入法 for Windows
http://chewing.csie.net/
IE Tab Firefox plugin/extension
http://ietab.mozdev.org/
PCMan 油畫作品集:
http://www.wretch.cc/album/album.php?id=pcman&book=1
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 163.29.223.38
→ HZYSoft:這次這個沒辦法簡單完成了,還是需要 11 行 XD 04/06 01:46
→ HZYSoft:免下載,免安裝,使用系統內建功能,萬歲! 04/06 01:48
→ sky008888:pcman 親自出馬了 04/06 02:03
→ HZYSoft:茶餘飯後寫寫小程式有益身心健康 04/06 02:05
推 imrt:強!不知道 PCman 大大有沒有要開班授課教 wscript? 04/06 02:08
推 HZYSoft:問題是我根本沒有學過,都是要用隨時 Google 04/06 02:10
推 ateclean:喔~~~推一個XD 04/06 04:35
推 PcGrek:不知pcman是在linux還是windows下寫的?...(純粹好奇) 04/06 08:55
→ mosquito520:windows底下吧...linux不支援VBS不是嗎? 04/06 10:26
推 LiloHuang:perl -e "print reverse <>" Input.txt > Output.txt 04/06 12:02
→ LiloHuang:如果有人用Linux或有灌Perl的 這種反轉問題上面一行搞定 04/06 12:03
推 ckclark:tac Input.txt > Output.txt 也是一行搞定 04/06 12:50
推 dancequiet:太厲害了!雖然我很少用到這種功能,但是馬上出現小軟 04/06 15:46
→ dancequiet:體,真是太驚人了! 04/06 15:47
推 erspicu:這任務如果是以perl來寫,三行達成,只是還需額外安裝perl 04/06 16:05
推 sonyu:有tac就用tac啦XD 04/06 16:37
推 LiloHuang:cat tac 囧rz 可惜Win32沒內建這麼方便的指令XDD 04/06 17:15
推 huge:反貓好呀 XD 04/06 22:29
推 HZYSoft:Perl 很強,問題就是大多數 Windows 電腦沒裝 orz 04/07 00:06
推 realpiyo:剛試了一下,結果發現沒辦法轉 utf-8 的 .txt 檔 ~"~ 04/07 02:52