當前位置:編程學習大全網 - 源碼下載 - 求TXT隔行插入批處理軟件或程序?高手請進,在線等!

求TXT隔行插入批處理軟件或程序?高手請進,在線等!

我寫個au3 程序個妳吧,留下妳的郵箱,妳什麽操作系統xp、win7? 效果圖

autoit 源代碼 #include #include #include #include #include #NoTrayIcon#Region ### START Koda GUI section ### Form=$Form1 = GUICreate("Form1", 623, 449, 192, 114)$Label1 = GUICtrlCreateLabel("需要添加網址的文件", 16, 16, 112, 17)$Input1 = GUICtrlCreateInput(@DesktopCommonDir, 16, 48, 481, 21)$Label2 = GUICtrlCreateLabel("每多少行加入壹個網址", 16, 130, 124, 17)$Input2 = GUICtrlCreateInput("1000", 16, 160, 161, 21)$Label3 = GUICtrlCreateLabel("需要添加的網址", 16, 270, 112, 17)$Input3 = GUICtrlCreateInput("/veket_linux", 16, 300, 481, 21)$Button1 = GUICtrlCreateButton("瀏覽", 392, 96, 105, 49)$Button2 = GUICtrlCreateButton("Go", 392, 224, 105, 49)GUISetState(@SW_SHOW)#EndRegion ### END Koda GUI section ###While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $filepath = FileOpenDialog("瀏覽",@DesktopCommonDir,"文本文檔(*.txt)","","",$Form1) GUICtrlSetData($Input1,$filepath) Case $Button2 addlink($filepath,GUICtrlRead($Input2),GUICtrlRead($Input3)) EndSwitchWEndFunc addlink($path,$n,$link) $index = StringInStr($path,"\",-1) $file = StringMid($path,$index+1) $dir = StringLeft($path,$index) $index2 = StringInStr($file,".",-1) $newfile = $dir&StringLeft($file,$index2-1)&"_add_link.txt" $f1 = fileOpen($newfile,10) $f2 = FileOpen($path) $i = 1 $str = "" $line = "" While 1 $line = FileReadLine($path,$i) If @error = -1 Then ExitLoop $str = $str&$line&@CRLF If 0 = Mod($i,$n) Then $str = $str&$link&@CRLF $i +=1 WEnd FileWrite($newfile,$str) FileClose($f1) FileClose($f2) MsgBox(64,"添加完成",$newfile)EndFunc

  • 上一篇:酒店IPTV電視直播點播系統方案有哪些
  • 下一篇:怎麽把button變成圓形
  • copyright 2024編程學習大全網