简体   繁体   中英

Download Website with formatting using Wget

I have a PHP script which runs on our website and echos a bunch of content to the browser, each line has a unique ID. I installed GnuWin32 and wrote a small BAT script to download this content to a TXT file which is working fine, however when viewed in Notepad it has lost the line breaks.

I have tried appending "\\r\\n" and "\\n" to the echo string in the PHP script but still have this issue. Can anyone please point out where my mistake is?

@echo off
setlocal
set TARGET=website.com/report_file.php
wget -O ServerID.txt -p %TARGET%
endlocal

Maybe you have LF ( 0x0a ) terminated lines in your .txt file. Notepad handles CRLF ( 0x0d 0x0a ) terminated lines.

If you are using gnuwin32, you can use conv to change the line endings in your file.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM