日本免费高清视频-国产福利视频导航-黄色在线播放国产-天天操天天操天天操天天操|www.shdianci.com

學無先后,達者為師

網(wǎng)站首頁 編程語言 正文

批處理從html格式(接收到的郵件)中讀取數(shù)據(jù)的操作方法_DOS/BAT

作者:列兵 ? 更新時間: 2023-02-10 編程語言

通過第三方批處理getmail可以獲取到郵箱里的郵件。獲取后經(jīng)其自身解碼,得到一個Extract*.out文件,大致看一下其格式應該為html的寫法,并且內(nèi)容只分一行。

<div dir="auto">here is the content</div>

顯然我郵件發(fā)送的原內(nèi)容為:

here is the content

現(xiàn)在要提取出其中的原內(nèi)容并且將所有內(nèi)容合并到一行。問題在于,郵箱不一定每次都接收到這樣簡單的文件。例如內(nèi)容當中出現(xiàn)換行:

<div dir="auto">abababababababab<br /><br />abababababababab<br /><br /></div>

有時內(nèi)容含特殊字符,解碼之后也無法正常顯示(某些字符):

i wanna get these words # $ % & * @ ? !
<div dir="auto">i wanna get these words # $ % &amp; * &#64; ? !</div>

有時發(fā)送的內(nèi)容經(jīng)過復制粘貼,不小心留下了其他信息:

<div dir="auto">hey get it <span style="font-family:sans-serif">hey get it </span><br style="font-family:sans-serif" /><span style="font-family:sans-serif">hey get it </span><span style="font-family:sans-serif">hey get it </span><br style="font-family:sans-serif" /></div>

顯然需要忽略<>標簽里的所有內(nèi)容才能得到原內(nèi)容,并且需要還原未正常顯示的符號。
可能要用到第三方了……

原文鏈接:http://www.bathome.net/viewthread.php?from=notice&tid=64776

欄目分類
最近更新