[請問] 批次檔 如何截取字串?

看板EZsoft (小軟體)作者 (大地彩妝果園)時間7年前 (2018/01/07 18:37), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串1/2 (看更多)
@echo off set /p t=請輸入欲查詢的日期: echo %t% pause echo 將網址存成變數ifo: set ifo="http://www.twse.com.tw/exchangeReport/MI_INDEX?response=csv&type=ALLBUT0999&date=%t%" echo %ifo% echo 截取第1個到倒數第1個字符並記錄在url.txt: echo %ifo:~1,-1% > url.txt wget -O "all.csv" -i url.txt 失敗 url.txt的內容: 系統無法接受輸入的日期。 輸入新日期: (yy-mm-dd) ====================== wget -O "all.csv" -i url.txt url.txt裡的網址不能是 "http://www.twse.com.tw/exchangeReport/MI_INDEX?response=csv&type=ALLBUT0999&date=20180105" 要想辦法弄成 http://www.twse.com.tw/exchangeReport/MI_INDEX?response=csv&type=ALLBUT0999&date=20180105 但我弄不出來 會不會是跟 那個 date 有關 >_<" -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 163.27.107.1 ※ 文章網址: https://www.ptt.cc/bbs/EZsoft/M.1515321428.A.EEA.html
文章代碼(AID): #1QKVXKxg (EZsoft)
文章代碼(AID): #1QKVXKxg (EZsoft)