How to add 'del ' as leading sttring of all lines of a file ?
Posted: 02 Jun 2020 12:10
Hi all,
I am regularly updating files to my website www.vorticity.de - meteorological data.
Procedure: files are regularly overwritten by files with identical name, but new data.
Problem: Due to any Proxy or cache, only overwriting files does not guarantee that files with
new data are delivered to any browser call - deleting old files before uploading new files helps!
Solution: Delete files file1.jpg file2.jpg ... before uploading file1.jpg file2.jpg ... using ftp del
My problem: writing file1.jpg file2.jpg ... into a file for the ftp_delete_script is easy...
> but how can I put 'del ' as leading string of each line with a filename ?
Should be easy and I am sure, some of you know better and smarter than me by guessing...!
Thanks for any constructive help!
To repeat in short: I create a file D:\FTP\xftp_upload.cmd to delete existing files as follows
ftp -s:d:\FTP\xftp_upload.txt
The file xftp_upload.txt should look as follows
open ftp.vorticity.de
user
password
del file1.jpg
del file2.jpg
del file3.jpg
The problem is how to write the leading string 'del ' before each line of the file,
the filenames are easy using dir > xftp_upload.txt
Any help more than welcome!
Regards, Bernd.
I am regularly updating files to my website www.vorticity.de - meteorological data.
Procedure: files are regularly overwritten by files with identical name, but new data.
Problem: Due to any Proxy or cache, only overwriting files does not guarantee that files with
new data are delivered to any browser call - deleting old files before uploading new files helps!
Solution: Delete files file1.jpg file2.jpg ... before uploading file1.jpg file2.jpg ... using ftp del
My problem: writing file1.jpg file2.jpg ... into a file for the ftp_delete_script is easy...
> but how can I put 'del ' as leading string of each line with a filename ?
Should be easy and I am sure, some of you know better and smarter than me by guessing...!
Thanks for any constructive help!
To repeat in short: I create a file D:\FTP\xftp_upload.cmd to delete existing files as follows
ftp -s:d:\FTP\xftp_upload.txt
The file xftp_upload.txt should look as follows
open ftp.vorticity.de
user
password
del file1.jpg
del file2.jpg
del file3.jpg
The problem is how to write the leading string 'del ' before each line of the file,
the filenames are easy using dir > xftp_upload.txt
Any help more than welcome!
Regards, Bernd.