中国DOS联盟论坛

中国DOS联盟

-- 联合DOS 推动DOS 发展DOS --

联盟域名:www.cn-dos.net  论坛域名:www.cn-dos.net/forum
DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!

游客:  注册 | 登录 | 命令行 | 会员 | 搜索 | 上传 | 帮助 »
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [讨论]关于Firefox的收藏夹转成IE的收藏夹的问题
« [1] [2] »
作者:
标题: [讨论]关于Firefox的收藏夹转成IE的收藏夹的问题 上一主题 | 下一主题
honghunter
中级用户





积分 321
发帖 135
注册 2007-2-4
状态 离线
『第 16 楼』:  

再次感谢!

这个问题解决了,现在已经正确取出来了。目前只剩下3楼说道的,UTF8转成GBK的问题了,我回到家再查查。



@echo off & color 02 & setlocal enabledelayedexpansion

@rem/ init
set temp_path_last=1

for /f "delims=<> tokens=1-5" %%a in ('findstr /i "<DT><H3[^>]*>.*</H3> <DT><A[^>]*>.*</A>" bookmarks_ansi.html') do (
@rem/                echo a=%%a;b=%%b;c=%%c;d=%%d;e=%%e;
    if /i "%%e"=="/H3" (echo\&echo\-----& call:sub_fix_path "#%%a#" %%d)
    if /i "%%e"=="/A" (
        (for /f "usebackq tokens=2" %%a in ('%%c') do (
            set mystr=%%a
            echo url=!mystr:~5!;
        )) 2>nul
        echo notes=%%d
    )
)
endlocal&pause
goto :eof


:sub_fix_path

        set temp_path=%~1
        set temp_path_name=%2

        if "%temp_path%"=="#    #" set temp_path=1
        if "%temp_path%"=="#        #" set temp_path=2
        if "%temp_path%"=="#            #" set temp_path=3
        if "%temp_path%"=="#                #" set temp_path=4
        if "%temp_path%"=="#                    #" set temp_path=5
        if "%temp_path%"=="#                        #" set temp_path=6
       
  set "tmp_dir%temp_path%=%temp_path_name%\\"
  
  if %temp_path% EQU 1 ( set "tmp_dir2=" & set "tmp_dir3=" & set "tmp_dir4=" & set "tmp_dir5=" )
  if %temp_path% EQU 2 ( set "tmp_dir3=" & set "tmp_dir4=" & set "tmp_dir5=" )
  if %temp_path% EQU 3 ( set "tmp_dir4=" & set "tmp_dir5=" )
  if %temp_path% EQU 4 ( set "tmp_dir5=" )
  
  set temp_path_full=%tmp_dir1%%tmp_dir2%%tmp_dir3%%tmp_dir4%%tmp_dir5%
  set temp_path_last=%temp_path%
  
  echo mkdir "%temp_path_full%"

goto :eof



探讨批量下载与智能化的下载
2008-1-14 18:54
查看资料  发短消息 网志   编辑帖子  回复  引用回复
honghunter
中级用户





积分 321
发帖 135
注册 2007-2-4
状态 离线
『第 17 楼』:  

目前的输出效果(批处理文件见16楼)



-----
mkdir "00-TMP\\"
url="http://www-128.ibm.com/developerworks/cn/java/j-ap08016/";
notes=让开发自动化: 持续检查
url="http://www.cn-dos.net/forum/index.php";
notes=中国DOS联盟论坛 - 中国DOS联盟之联合DOS论坛
url="http://www.cnblogs.com/jobs/archive/2004/08/13/33065.aspx";
notes=测试开发驱动实践 - 温少的日志 - 网志园
url="http://www.cnblogs.com/unruledboy/archive/2004/08/13/33227.html";
notes=关于Peer Review、代码评审和测试驱动等 - 灵感之源 - 网志园

-----
mkdir "00-TMP\\sub_temp\\"
url="http://forum.ubuntu.org.cn/index.php?sid=6c885f42cc736f815a552322ca5d9e56";
notes=Ubuntu中文 论坛 :: 首页

-----
mkdir "01-办公\\"

-----
mkdir "02-常用\\"



探讨批量下载与智能化的下载
2008-1-14 18:56
查看资料  发短消息 网志   编辑帖子  回复  引用回复
honghunter
中级用户





积分 321
发帖 135
注册 2007-2-4
状态 离线
『第 18 楼』:  

3楼说道的,UTF8转成GBK的问题也解决了。是用论坛里面的代码改的。

现在一般的已经可以了,存在的问题是:怎么得到一个有效的文件名?


类似下面这样的命令会报错:

Shortcut.exe /f:"E:\aaaaaa\K05_sys\Favorites\00-TMP\\sub_temp\\sub2\\Ubuntu中文 论坛 :: 首页.lnk" /a:c /t:"http://forum.ubuntu.org.cn/index.php?sid=6c885f42cc736f815a552322ca5d9e56"

System error 87 has occurred.

参数不正确。


正确的例子如下:
Shortcut.exe /f:"E:\aaaaaa\K05_sys\Favorites\02-常用\\LWP 与 WEB 的基本使用.lnk" /a:c /t:"http://www.perlchina.org/archive/archive.php?action=archive&page=15"

The command completed successfully.

[ Last edited by honghunter on 2008-1-16 at 12:39 AM ]



探讨批量下载与智能化的下载
2008-1-16 00:37
查看资料  发短消息 网志   编辑帖子  回复  引用回复
honghunter
中级用户





积分 321
发帖 135
注册 2007-2-4
状态 离线
『第 19 楼』:  

我数了一下, 87应该就是“Ubuntu中文 论坛 :: 首页.lnk”中的那个":"在命令行的位置。



探讨批量下载与智能化的下载
2008-1-16 00:41
查看资料  发短消息 网志   编辑帖子  回复  引用回复
honghunter
中级用户





积分 321
发帖 135
注册 2007-2-4
状态 离线
『第 20 楼』:  

对于这个问题,我目前考虑的做法是:
尝试把可能出现在其中的,但是有不能成为文件名组成部分的字符串替换掉。

在论坛里面搜索了一阵,还是觉得无从下手。



探讨批量下载与智能化的下载
2008-1-16 01:25
查看资料  发短消息 网志   编辑帖子  回复  引用回复
« [1] [2] »
请注意:您目前尚未注册或登录,请您注册登录以使用论坛的各项功能,例如发表和回复帖子等。


可打印版本 | 推荐给朋友 | 订阅主题 | 收藏主题



论坛跳转: