SO中文参考
首页
(current)
程序语言
c
java
python
c++
go
javascript
swift
c#
操作系统
linux
ubuntu
centos
unix
数据库
oracle
mysql
mongodb
postgresql
框架
node.js
angular
react-native
avalon
django
twisted
hadoop
.net
移动开发
android
ios
搜索
oas
相关问题
最新问题
BAT 脚本未从文本文件返回最新链接测试&...</desc> <question vote="-1"> <p>我试图获取最新的</p> <pre><code><a href> </code></pre> <p>来自 temp.txt 文件下方的链接,即 122 </p> <pre><code><html> <head><meta name="robots" content="noindex" /> <title>test</title> </head> <body> <h1>test</h1> </pre><hr/> <pre><a href="../">../</a> <a href="100/">100/</a> 23-Mar-2022 17:12 - <a href="111/">111/</a> 21-Mar-2023 12:08 - <a href="112/">112/</a> 18-Apr-2023 07:46 - <a href="113/">113/</a> 25-May-2023 21:15 - ---- <a href="120/">120/</a> 11-Dec-2023 10:43 - <a href="121/">121/</a> 30-Jan-2024 07:31 - **<a href="122/">122/</a> 11-Mar-2024 06:00 -** <a href="93/">93/</a> 24-Aug-2021 16:07 - <a href="94/">94/</a> 12-Oct-2021 11:21 - <a href="95/">95/</a> 26-Oct-2021 16:25 - <a href="97/">97/</a> 06-Jan-2022 15:23 - <a href="98/">98/</a> 07-Feb-2022 16:04 - <a href="99/">99/</a> 10-Mar-2022 12:18 - <a href="json/">json/</a> 03-Apr-2024 04:26 - <a href="linux/">linux/</a> 17-Jun-2020 12:06 - <a href="known-good-version-with-downloads.json">known-good-version-with-downloads.json</a> 01-Apr-2024 07:03 1.39 KB </pre> <hr/><address style="font-size:small;">Artifactory/7.49.12 Server at artifactrepository.xxxxxx.net Port 80</address></body></html> </code></pre> <p>我使用了下面的批处理脚本</p> <pre><code>@echo off setlocal enabledelayedexpansion set "latestHref=" for /f "tokens=*" %%a in ('type temp.txt ^| findstr /i "href="') do ( set "href=%%a" set "href=!href:*href=!" for /f "tokens=2 delims==" %%b in ("!href!") do ( set "latestHref=%%~b" ) ) if defined latestHref ( echo Latest href link: !latestHref! ) else ( echo No href links found in the text file. ) </code></pre> <p>但是每次我收到<strong>在文本文件中找不到href链接</strong>有人可以帮助我吗? 我原本期望结果为 122,但结果仍然错误</p> </question> <answer tick="false" vote="0"> <p>过滤 <pre><code><a href="NUMBERS</code></pre> 行,如果找到的数字比以前大,则调整 <pre><code>!latestHref!</code></pre>(使用调整后的分隔符):</p> <pre><code>@echo off setlocal enabledelayedexpansion set "latestHref=" for /f "tokens=*" %%a in ('type temp.txt ^| findstr /i "href=\"[0-9][0-9]*') do ( set "href=%%a" set "href=!href:*href=!" for /f tokens^=2delims^=/^" %%b in ("!href!") do ( if %%b gtr !latestHref! set "latestHref=%%~b" ) ) if defined latestHref ( echo Latest href link: !latestHref! ) else ( echo No href links found in the text file. </code></pre> <p>输出:</p> <pre><code>Latest href link: 122 </code></pre> </answer> </body></html>
无法在 Firebase 云中部署新功能或删除现有功能[重复]
AWS 是否在其服务中提供任何 IDS/IPS 或建议一些预算友好的第三方服务
通过plotly绘制线串几何图形的3d图
单击按钮后未清除选择
R编程调试
如何使用 clostache 迭代地图向量
为什么海龟在第一次迭代中没有将组件定位在正确的位置
VBA 嵌套 if-do-while 来求和值
介绍屏幕后重定向页面
ModuleNotFoundError:Ubuntu Spyder 5.3.0 中没有名为“qdarkstyle.colorsystem”的模块
Riverpod:在 ConsumerWidget 中重写 initState 的替代方法
Excel Ribbon 组合框:设置多张纸张尺寸
Flink 作业设计 - 使用混合 Kafka 主题
如何防止 Web 应用程序上的第三方浏览器扩展进行样式注入
将不同的卡片导航到各自的页面
如何缩小按钮上的图像尺寸?
为什么接口中的所有函数都必须是公共的?
有人可以检查一下这个代码吗?倒计时截止时间为下午 2 点,但不包括周末和英国银行假期
带有电子表格分组表的文档
© www.soinside.com 2019 - 2024. All rights reserved.