Jump to content

save to html from every url


vinnyMS1
 Share

Recommended Posts

@argumentum Shopify is an online shopping cart host, that anyone can join.  It appears he wants Vinny wants to prepend and append too each line of text.

@vinnyMS1

Couple of quick examples:

#include <Array.au3>
#include <File.au3>
Global $g_sPrefix = "/products/"
Global $g_sSuffix = ".html"

;~ Example 1
Global $g_aURLs
_FileReadToArray(@ScriptDir & "\url.txt", $g_aURLs)
If @error Then Exit MsgBox(4096, "Error", "Unable to read url.txt to Array")
_ArrayDisplay($g_aURLs, "Before Changes")
For $i = 1 To $g_aURLs[0]
    $g_aURLs[$i] = $g_sPrefix & $g_aURLs[$i] & $g_sSuffix
Next
_ArrayDisplay($g_aURLs, "After Changes")

;~ Example 2
$sURLs = $g_sPrefix & StringRegExpReplace(FileRead(@ScriptDir & "\url.txt"), "(?:\r\n|\n)", $g_sSuffix & @LF & $g_sPrefix & "$1") & $g_sSuffix
ConsoleWrite(StringReplace($sUrls,"/products/.html", "") & @CRLF)

 

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...