reading comma seperated text - 09/01/06 11:10 PM
is it possible to read in a txt file a with a comma (,) seperated text like :
Our members have made a total of <b>22,708</b> posts<br
i want to read the 22,708 by using this code:
on *:TEXT:!forumstats*:*:{ if ($1) { getpdm $iif(#,#,$nick) $2 } }
alias getpdm { .remove p.txt | sockopen pdm dc-styles.com 80 | sockmark pdm $1- }
on *:sockopen:pdm:{ sockwrite -n pdm GET http://www.dc-styles.com/forums/index.php | sockwrite -n pdm Accept: */* | sockwrite -n pdm Host: dc-styles.com:80 | sockwrite -n pdm Proxy-Connection: Keep-Alive | sockwrite -n pdm $crlf }
on *:sockread:pdm:{ if ($sockerr) { return }
:read
sockread &pvar | bwrite p.txt -1 -1 &pvar | if ($sockbr) { goto read }
}
on *:sockclose:pdm:{
tokenize 32 $sock($sockname).mark
if ($regex(xx,$read(p.txt, w,$+(*,Our members have made a,*)),total of <b>([[:digit:]]+))) { msg $1 Total Posts: $regml(xx,1) }
else { msg $1 No matched found }
}
but the result is: Total Posts: 22 instead of 22,708
someone plz help me out! how do i make it it shows the full number or convert the , to a .
DrDevil
Our members have made a total of <b>22,708</b> posts<br
i want to read the 22,708 by using this code:
on *:TEXT:!forumstats*:*:{ if ($1) { getpdm $iif(#,#,$nick) $2 } }
alias getpdm { .remove p.txt | sockopen pdm dc-styles.com 80 | sockmark pdm $1- }
on *:sockopen:pdm:{ sockwrite -n pdm GET http://www.dc-styles.com/forums/index.php | sockwrite -n pdm Accept: */* | sockwrite -n pdm Host: dc-styles.com:80 | sockwrite -n pdm Proxy-Connection: Keep-Alive | sockwrite -n pdm $crlf }
on *:sockread:pdm:{ if ($sockerr) { return }
:read
sockread &pvar | bwrite p.txt -1 -1 &pvar | if ($sockbr) { goto read }
}
on *:sockclose:pdm:{
tokenize 32 $sock($sockname).mark
if ($regex(xx,$read(p.txt, w,$+(*,Our members have made a,*)),total of <b>([[:digit:]]+))) { msg $1 Total Posts: $regml(xx,1) }
else { msg $1 No matched found }
}
but the result is: Total Posts: 22 instead of 22,708
someone plz help me out! how do i make it it shows the full number or convert the , to a .
DrDevil