主题 : 12月21日 10-11赛季NBA常规赛 马刺VS太阳 国语 RMVB 886MB【QQ+115+BT】
级别: 小小球童
80  发表于: 2010-12-21 12:24

        
级别: 小小球童
81  发表于: 2010-12-21 12:27

回 楼主(忘年) 的帖子

  
马刺!!!
级别: 替补球员
82  发表于: 2010-12-21 12:28

回 楼主(忘年) 的帖子

function stripHTML(document,fieldname)
       str = document:getFieldValue(fieldname)
       if str ~=nil then
           mylog("str is not nil");
               str = string.gsub(str,"<.->","")        
               str=stripBlank(str);
               str = convertEntities(str)
               --mylog("str========\n"..str);
               document:setFieldValue(fieldname, str)
      else
         mylog("str is  nil");
      end
          
end

--strip the blank lines
function stripBlank(str)
     str = string.gsub(str,"(\n+)","\n")
     return str;
end

function convertEntities(str)
  
local entities =
{
    -- chinese entities,I get it from http://www.w3schools.com/HTML/html_entities.asp
    --your lua scipts file should save in u8-dos,otherwise some code here will convert into question mark
    nbsp = " ",
    lt = "<",
    gt = ">",
    amp = "&",

}
       str = string.gsub(str, "&(%a+);",entities)
       return str
end
function stripHTML(document,fieldname)
       str = document:getFieldValue(fieldname)
       if str ~=nil then
           mylog("str is not nil");
               str = string.gsub(str,"<.->","")        
               str=stripBlank(str);
               str = convertEntities(str)
               --mylog("str========\n"..str);
               document:setFieldValue(fieldname, str)
      else
         mylog("str is  nil");
      end
          
end

--strip the blank lines
function stripBlank(str)
     str = string.gsub(str,"(\n+)","\n")
     return str;
end

function convertEntities(str)
  
local entities =
{
    -- chinese entities,I get it from http://www.w3schools.com/HTML/html_entities.asp
    --your lua scipts file should save in u8-dos,otherwise some code here will convert into question mark
    nbsp = " ",
    lt = "<",
    gt = ">",
    amp = "&",

}
       str = string.gsub(str, "&(%a+);",entities)
       return str
end
function stripHTML(document,fieldname)
       str = document:getFieldValue(fieldname)
       if str ~=nil then
           mylog("str is not nil");
               str = string.gsub(str,"<.->","")        
               str=stripBlank(str);
               str = convertEntities(str)
               --mylog("str========\n"..str);
               document:setFieldValue(fieldname, str)
      else
         mylog("str is  nil");
      end
          
end

--strip the blank lines
function stripBlank(str)
     str = string.gsub(str,"(\n+)","\n")
     return str;
end

function convertEntities(str)
  
local entities =
{
    -- chinese entities,I get it from http://www.w3schools.com/HTML/html_entities.asp
    --your lua scipts file should save in u8-dos,otherwise some code here will convert into question mark
    nbsp = " ",
    lt = "<",
    gt = ">",
    amp = "&",

}
       str = string.gsub(str, "&(%a+);",entities)
       return str
end
级别: 替补球员
83  发表于: 2010-12-21 12:29

j;lkj;lkj;lk;lk;lkj;l
级别: 小小球童
84  发表于: 2010-12-21 12:30

    
级别: 替补球员
85  发表于: 2010-12-21 12:30

 
级别: 替补球员
86  发表于: 2010-12-21 12:32

dddddddddddddddddddddddddd
级别: 替补球员
87  发表于: 2010-12-21 12:33

      
脑壳青痛
级别: 小小球童
88  发表于: 2010-12-21 12:33

神速,佩服,谢谢楼主
级别: 小小球童
89  发表于: 2010-12-21 12:33