Sign in to follow this  
Followers 0
zxzxzx

Replace this string ?

7 posts in this topic




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

Share this post


Link to post
Share on other sites

Thank you very much!

Share this post


Link to post
Share on other sites

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)

[center]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.[/center]

Share this post


Link to post
Share on other sites

SmOke_N

Great! Thank you for nice example! Posted Image

Share this post


Link to post
Share on other sites

Probably wiser NOT to string split on comma since I believe commas are valid url characters.

Share this post


Link to post
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
Sign in to follow this  
Followers 0