Last active
August 1, 2017 15:53
-
-
Save RaccoonDev/7b1094aee834505f75c622eb575bc7b1 to your computer and use it in GitHub Desktop.
Download files by list of URL in a text file
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import scala.io.Source | |
import sys.process._ | |
import java.net.URL | |
import java.io.File | |
Source.fromFile("name_of_file_that_contains_list_of_urls.txt") | |
.getLines | |
.zipWithIndex | |
.foreach { case(line, count) => new URL(line) #> new File(s"output_file_name_$count.txt") !! } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment