How to import .url files into one text file?

Page 1 of 2 12 LastLast

  1. Posts : 25
    Windows 10 (1903)
       #1

    How to import .url files into one text file?


    Hi,
    I have more than 1000 .url files (files you obtain when you drag an URL from your web browser to your Windows file explorer).

    How to send all these URLs into one txt file at once?

    - - - Updated - - -

    Failed solution 1:
    create an Excel spreadsheet>Data tab>Get Data>From Folder
    Excel only lists the file names, not the URLs inside.
      My Computer

  2.   My Computer


  3. Posts : 16,950
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #3

    Move/copy them into
    C:\Users\%UserName%\Favorites
    then, in your browser, import Favorites from IE
    and then export them to an htm file [which is a text-based format so I assume that suits what you wanted].

    Denis
      My Computer


  4. Posts : 2,799
    Linux Mint 20.1 Win10Prox64
       #4

    @Shenmue is life
    save the lines below to a BAT file, eg. List.bat:
    @echo off
    set URL="J:\_PowerShell\URLLinks"
    for /f "tokens=2 delims=^=^(" %%a in ('type %URL%\*.url 2^>nul ^| find "URL=http"') do echo %%a


    NOTE: change 2nd line to point to the folder where all URL links stored.

    Open Command then run, Type List.bat should give you a list of URL links
    To save to a txt file, Type: List.bat > URL_List.txt
      My Computer


  5. 3nd
    Posts : 860
    Zorin Lite
       #5

    Failed solution 1:
    create an Excel spreadsheet>Data tab>Get Data>From Folder
    Excel only lists the file names, not the URLs inside.
    if you want to use excel ,try this
      My Computer


  6. Posts : 456
    Windows 10
       #6

    How exactly do you want the text file to look like just a link in each line?

    Here is another batch file, save this code in notepad and save the file with the name that you want but with a .bat extension. Then drag and drop the folder where the *.url files are to the batch file.

    Code:
    @echo off
    
    :: Drag and drop the folder where the url files are to this batch file
    
    if exist "%~1" (if not exist "%~1\" exit) else (exit)
    
    pushd "%~1"
    for /f "Delims=" %%a in ('dir /b *.url') do for /f "tokens=2 delims==" %%b in ('type "%%~a" ^|find "URL="') do >>"%~dp0\URLs.txt" echo %%b

    Last edited by ricardobohner; 04 May 2022 at 10:16.
      My Computer


  7. Posts : 1,680
    X
       #7

    If you have Linux on Windows, just run this from a shell:

    Code:
    strings *.url | grep URL= | sed -e "s/URL=//" >some-file-name
      My Computer


  8. Posts : 16,950
    Windows 10 Home x64 Version 22H2 Build 19045.4170
       #8

    ricardobohner said:
    ~dp0\
    Ricardo,

    ~dp0 ends with a backslash so
    ~dp0\ causes a double backslash and the output fails.

    All the best,
    Denis
      My Computer


  9. Posts : 456
    Windows 10
       #9

    Try3 said:
    Ricardo,

    ~dp0 ends with a backslash so
    ~dp0\ causes a double backslash and the output fails.

    All the best,
    Denis

    Thanks, it should be "%~dp0URLs.txt" but it works anyway as you see :)
      My Computer


  10. Posts : 7,607
    Windows 10 Home 20H2
       #10

    The system is smart enough to ignore a superfluous backslash.
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 10:20.
Find Us




Windows 10 Forums