Jump to content

Replace this string ?


 Share

Recommended Posts

If the links is in a file (Ex:DOC.txt)

#include <File.au3>

$FILE = FileOpen(@ScriptDir & "\DOC.TXT",0)
For $INDEX = 1 To _FileCountLines(@ScriptDir & "\DOC.TXT")
    $DATA = FileReadLine($FILE,$INDEX)
    $NAME = StringSplit($DATA,",")
    MsgBox(0,$INDEX,$NAME[2])
Next
FileClose($FILE)

When the words fail... music speaks.

Link to comment
Share on other sites

  • Moderators

zxzxzx

Try this:

$ReadFile = FileRead("c:\url.txt")

$aStrings = StringSplit($ReadFile, @CR & @LF, 1)

$hFile = FileOpen("c:\url.txt", 2)

For $i = 1 To $aStrings[0]
    FileWriteLine($hFile, StringRegExpReplace($aStrings[$i], "^\d*,", ""))
Next

FileClose($hFile)oÝ÷ Ûú®¢×ßÙ¢Þ²Çʮ׫²Ú(vØZ´-j·jØ­~ÚÂ¥zÚòx- Ú0¶­Ê·ö÷°®+mz{aj×(.׫²Ö§u»­Ê¢é]v­Â+a¢ëZ)jëh×6Local $s_write = StringRegExpReplace(FileRead("c:\url.txt"), "(^|\n)(\d*,)", "\1")
FileClose(FileOpen("c:\url.txt", 2))
FileWrite("c:\url.txt", $s_write)

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...