China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-20 17:29
中国DOS联盟论坛 » DOS批处理 & 脚本技术(批处理室) » [Help] How to extract QQ numbers from Info.db of QQ2009 (Solved) View 6,847 Replies 30
Floor 16 Posted 2009-03-03 15:08 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
I'm too lazy to install 2009. How did you replace it?

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 17 Posted 2009-03-03 15:33 ·  中国 吉林 延边朝鲜族自治州 电信
银牌会员
★★★
正在学习中的菜鸟...
Credits 1,039
Posts 897
Joined 2009-03-01 15:34
17-year member
UID 140302
Gender Male
From 在地狱中仰望天堂
Status Offline
Uploaded QQ2009 information info.db file http://upload.cn-dos.net/img/1348.rar

For example, there are the following garbled codes:

涳艛?忌:J垟麳]CF K-婣硵艛?忌:鉁s?殸⑽矎?
NF 
 515187266 9TD  傢ろ
04  435853964 -TD 傘18娿
?
 5? o欙L(   } ~搁搁块€8362-406
務蠚崄u39E拞r 515187266 >TD 
ffffTA ?{-%/%//>PWf@=Oφ≌οη∠┫


Requirement: Display digital strings in separate lines.
1. Since the QQ number and the numbers in the garbled code may be connected together due to directly filtering other characters, making it impossible to distinguish, I personally think that replacement should be used.
2. Because there are digital strings like 8362-406 in the garbled code, the - should not be filtered out during filtering.
3. Since there are numbers in this garbled code, the consecutive digital strings with less than 5 digits are required to be deleted.
4. Because there are digital strings like 8362-406 in the garbled code, which are not QQ numbers, delete the digital strings containing -.
5. Delete duplicate digital strings

Example effect after extracting the QQ number:

435853964
515187266


[ Last edited by Hanyeguxing on 2009-3-4 at 01:16 ]
Floor 18 Posted 2009-03-03 15:38 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
Batch file names cannot be the same as commands. They cannot be saved as COPY, FR, etc.

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 19 Posted 2009-03-03 15:38 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
Just upload one file.

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 20 Posted 2009-03-03 18:55 ·  中国 吉林 延边朝鲜族自治州 电信
银牌会员
★★★
正在学习中的菜鸟...
Credits 1,039
Posts 897
Joined 2009-03-01 15:34
17-year member
UID 140302
Gender Male
From 在地狱中仰望天堂
Status Offline
Thanks to the enthusiastic help of the upstairs big.
Floor 21 Posted 2009-03-04 00:13 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
Still, let's first explain the purpose of what you're doing. What exactly is the reason for doing this? Is it to extract QQ numbers, or is it simply to replace characters other than QQ numbers

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 22 Posted 2009-03-04 00:17 ·  美国 惠普HP
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
There were already 10-digit QQ numbers a long time ago ^_^
Floor 23 Posted 2009-03-04 01:17 ·  中国 吉林 延边朝鲜族自治州 延吉市 电信
银牌会员
★★★
正在学习中的菜鸟...
Credits 1,039
Posts 897
Joined 2009-03-01 15:34
17-year member
UID 140302
Gender Male
From 在地狱中仰望天堂
Status Offline
Originally posted by yishanju at 2009-3-4 00:13:
Still, first explain the purpose of what you're doing
What exactly is the purpose of doing this
Is it to extract QQ numbers, or is it simply to replace characters other than QQ numbers

Of course, it's to extract QQ numbers...
This is what I did:
1. First, back up the file, use fr to replace all characters other than "-" and "0-9" with "Z" (because there are "-" in the messy numbers, so keep them, for example, 801056-105) as "Z".
2. Then merge "Z" into spaces
3. Then, split by spaces and newlines. But this command causes some numbers to be lost and errors during operation, and I don't know how to fix it.
4. Delete blank lines and spaces, special strings
5. Delete duplicate lines


@echo off&setlocal enabledelayedexpansion
copy info.db isee1.txt>nul 2>nul
fr -ric:"" -t:"Z" ISee1.txt
for /f "delims=" %%i in (ISee1.txt) do (
set han=%%i
>>ISee2.txt echo !han!
)
del ISee1.txt
fr -f:"ZZ" -t:"Z" ISee2.txt
find ISee2.txt "ZZ" && GOTO CC||fr -f:"Z" -t:" " ISee2.txt
for /f "tokens=1*" %%n in (ISee2.txt) do (
set xing=%%n
>>ISee1.txt echo !xing!
>>ISee1.txt echo !xing!
)
del ISee2.txt
for /f "delims=" %%k in (ISee1.txt) do (
set ye=%%k
set "ye=!ye: =!"
set "ye=!ye:012345789=!"
set "ye=!ye:0123456789=!"
>>ISee2.txt echo=!ye!
)
del ISee1.txt
setlocal disabledelayedexpansion
for /f "delims=" %%l in (ISee2.txt) do (
if not defined %%l set %%l=A & echo %%l>>ISee1.txt
)

del ISee2.txt

。。。。。。


6. ::Delete strings or lines with "-"
::Delete lines with fewer than 5 characters (continuous numbers in the mess will not reach 5 characters)
。。。。。。Hey, didn't get it right Last edited by Hanyeguxing on 2009-3-4 at 02:08 ]
Floor 24 Posted 2009-03-04 01:27 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
...
This is not at the same level in terms of difficulty, I don't know how to do it anymore

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Floor 25 Posted 2009-03-04 02:00 ·  中国 吉林 延边朝鲜族自治州 延吉市 电信
银牌会员
★★★
正在学习中的菜鸟...
Credits 1,039
Posts 897
Joined 2009-03-01 15:34
17-year member
UID 140302
Gender Male
From 在地狱中仰望天堂
Status Offline
Originally posted by yishanju at 2009-3-4 01:27:
。。。。
This is not just a level up in difficulty, I don't know how to do it anymore

Fleeing halfway is not kind... Haha
Floor 26 Posted 2009-03-04 05:37 ·  美国 惠普HP
版主
★★★★★
Credits 9,023
Posts 5,017
Joined 2007-05-31 19:39
19-year member
UID 89899
Gender Male
Status Offline
@echo off
echo Processing, please wait a few minutes...
sed "s//\n/g" Info.db>%temp%\a.txt
findstr ^*$ %temp%\a.txt>%temp%\b.txt
sort %temp%\b.txt>%temp%\c.txt
type nul>%temp%\d.txt
for /f "delims=" %%a in (%temp%\c.txt) do (
findstr /x /c:"%%a" %temp%\d.txt>nul 2>nul||echo.%%a>>%temp%\d.txt
)
start %temp%\d.txt
Recent Ratings for This Post ( 2 in total) Click for details
RaterScoreTime
netbenton +2 2009-03-04 07:57
Hanyeguxing +2 2009-03-04 09:47
Floor 27 Posted 2009-03-04 21:55 ·  中国 广东 深圳 电信
中级用户
★★
Credits 297
Posts 135
Joined 2006-10-21 12:00
19-year member
UID 67627
Gender Male
Status Offline
//&@cls&cscript -nologo -e:javascript "%~f0">r.txt&start r.txt&exit/b
WScript.Echo( new ActiveXObject("Scripting.FileSystemObject").OpenTextFile("Info.db").ReadAll().match( /{6,10}/gim ).join("\n") );
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
newxso +2 2009-04-24 05:33
Floor 28 Posted 2009-04-23 22:52 ·  中国 湖北 武汉 电信
中级用户
★★
Credits 247
Posts 83
Joined 2005-09-12 12:06
20-year member
UID 42446
Gender Male
Status Offline
Originally posted by HAT at 2009-3-4 05:37:
@echo off
echo 处理中,请稍等几分钟...
sed "s//\n/g" Info.db>%temp%\a.txt
findstr ^*$ %temp%\a.txt>%temp%\b.txt
sort %temp%\b ...

Originally wanted to reply according to this idea, but on closer inspection, I originally replied first
Floor 29 Posted 2009-04-24 00:50 ·  中国 广东 东莞 电信
银牌会员
★★★
批处理编程迷
Credits 1,916
Posts 752
Joined 2008-12-28 04:30
17-year member
UID 135147
Gender Male
From 广西
Status Offline
Can you replace all non-digits with 0a (newline character) when replacing? If possible, add a for /f %%a in (... and then all digit strings can be extracted. Then judge whether %%a is greater than 9999 to know whether it is a QQ number. This way, the speed will be much faster.

[ Last edited by netbenton on 2009-4-23 at 22:55 ]
Recent Ratings for This Post ( 1 in total) Click for details
RaterScoreTime
freeants001 +1 2009-04-24 06:55
精简
=> 个人网志
Floor 30 Posted 2009-04-24 03:08 ·  中国 北京 联通
银牌会员
★★★★
[b]看你妹啊[/b]
Credits 1,488
Posts 1,357
Joined 2006-05-20 12:00
20-year member
UID 55770
Status Offline
Then judge whether %%a is greater than 9999 to know whether it is a QQ number. This idea is brilliant!

有问题请发论坛或者自行搜索,再短消息问我的统统是SB
Forum Jump: