this will work for the text file(china cmd info.txt) at least on my pc it does.
I don't know if it will work for results from RunConsole2
need to see what the output looks like.
after line 4 in original function
add new line
and copy output and paste here so can see what coding string s is in
str s.getfile("$desktop$\china cmd info.txt")
s.trim
s.ConvertEncoding(936 _unicode)
;out s
int i tt ttt tttt tset
str disklist partitionlist1 partitionlist2
ARRAY(str) a=s
for(i a.len-1 -1 -1)
,if a[i].len = 0
,,a.remove(i)
for i 0 a.len
,a[i].trim
,if(findrx(a[i] "磁盘(?=\s\d*\s+联机)" 0 0) >=0)
,,if ttt=0
,,,disklist+ a[i]
,,,ttt+1
,,else
,,,disklist+"[]"
,,,disklist+ a[i]
,,,ttt+1
,if(a[i]="磁盘 0 现在是所选磁盘。")
,,tset=!tset
,if(a[i]="磁盘 1 现在是所选磁盘。")
,,tset=!tset
,if tset
,,if(findrx(a[i] "分区(?=\s+\d+)" 0 0)>=0)
,,,if tt=0
,,,,partitionlist1+ a[i]
,,,,tt+1
,,,else
,,,,partitionlist1 + "[]"
,,,,partitionlist1 +a[i]
,,,,tt+1
,else
,,if(findrx(a[i] "分区(?=\s+\d+)" 0 0)>=0)
,,,if tttt=0
,,,,partitionlist2+ a[i]
,,,,tttt+1
,,,else
,,,,partitionlist2 + "[]"
,,,,partitionlist2 +a[i]
,,,,tttt+1
int disknum= numlines(disklist)
int part1num= numlines(partitionlist1)
int part2num= numlines(partitionlist2)
out disknum
out part1num
out part2num
I don't know if it will work for results from RunConsole2
need to see what the output looks like.
after line 4 in original function
add new line
and copy output and paste here so can see what coding string s is in