34,590
社区成员
发帖
与我相关
我的任务
分享
发站: 漳州北 福州分区(1163) 南昌局.南 福建.闽(35) 国铁正式营业线[ 0]
到站: 玉溪南 昆明分区(1596) 昆明局.昆 云南.云(53) 国铁正式营业线[ 0]
经由:
径路类型:整车
全程:2581, 计费:284, 基金:284, 杂费:0
分界站数据:
1 琥市(RAQ 1590) 284公里 大 入 福州-> 广梅
2 东莞东(DMQ 1589) 720公里 小 出 广梅-> 广深
3 广州(GZQ 1431) 814公里 小 入 广深-> 广州
4 广州西(GXQ 1580) 820公里 小 入 广州-> 三茂
5 茂名(MMZ 1654) 1189公里 大 入 三茂-> 柳州
6 威舍(WSM 1992) 2156公里 大 入 柳州-> 昆明
经由分区数据:
1 福州 (1163) 284公里
2 广梅 (1264) 436公里
3 广深 (1265) 94公里
4 广州 (1266) 6公里
5 三茂 (1267) 369公里
6 柳州 (1371) 967公里
7 昆明 (1596) 425公里
省份里程数据:
1 福建.闽(35) 284公里
2 广东.粤(44) 1001公里
3 广西.桂(45) 722公里
4 贵州.贵(52) 149公里
5 云南.云(53) 425公里
set talk off
set stat on
set dele on
clear wind
close all
clear
if .not.file('rout\welroutnew.txt')
?
? 'Not found Data file : rout\welroutnew.txt'
=inkey(3)
clear
return
endif
if file('welroutxt.dbf')
erase welroutxt.dbf
endif
creat table welroutxt ( fz C(3), fzhz C(10), dz C(3), dzhz C(10);
, bdi C(2), bdo C(2), b2 C(2), bdic C(2), bdoc C(2), fjk C(120),verc C(8) )
close all
sele 2
use welroutxt
zap
appe blank
sele 1
creat table txt100 ( txt C(100) )
zap
appe sdf from rout\welroutnew.txt
go top
recnum=0
do while .not.eof(1)
do while subs(txt,1,5)<>'发站:' and .not.eof(1)
skip
enddo
if eof(1)
?
? '分析路径文本完成.'
exit
endif
@ 3,6 say str(recn(),8)+' /'+str(recc(),8)+' '
recnum=recn()
fzhz1=trim(subs(txt,7,10))
skip
dzhz1=trim(subs(txt,7,10))
skip 8 && Seek for 分界站
fjk0=''
fjk1=''
fjk2=''
fjk3=''
fjk4=''
do while subs(txt,5,10)>' '
fjk1=ltrim(subs(txt,5,10))
fjk0=fjk0+','+fjk1
if at(fjk1,'株洲,蒲圻,滩头湾,楠木塘;大龙,秀山;西斋;牙屯堡;;')>0
fjk2=fjk2+':'+padr(fjk1,6)
endif
if at(fjk1,';天水;平顶山西;郜营;胡家营;虞城县;')>0
fjk3=':'+padr(fjk1,6)
endif
if at(fjk1,';叶集;淮滨;攀枝花;凤凰山;六盘水南;')>0
fjk3=':'+padr(fjk1,6)
endif
if at(fjk1,';茂名,定南,琥市;;西河村,麻尾,威舍,达州,广元;')>0
fjk3=':'+padr(fjk1,6)
fjk3=strtran(fjk3,'西河村','河西村')
endif
if len(trim(fjk2))>15 and at('西河村',fjk2)>0
fjk2=strtran(fjk2,'西河村','')
endif
if len(trim(fjk2))>15 and at('河西村',fjk2)>0
fjk2=strtran(fjk2,'河西村','')
endif
if len(trim(fjk2))>15 and at(':麻尾 ',fjk2)>0
fjk2=strtran(fjk2,':麻尾 ','')
endif
if len(trim(fjk2))>15 and at(':威舍 ',fjk2)>0
fjk2=strtran(fjk2,':威舍 ','')
endif
if len(trim(fjk2))>15 and at(':达州 ',fjk2)>0
fjk2=strtran(fjk2,':达州 ','')
endif
if len(trim(fjk2))>15 and at(':广元 ',fjk2)>0
fjk2=strtran(fjk2,':广元 ','')
endif
skip
enddo
if len(trim(fjk2))<1
fjk2=fjk3
endif
fjk2=padr(fjk2,21,' ')
fjk4=fjk2+':'+fjk0
sele 2
*use rout\welroutxt
appe blank
repl fzhz with fzhz1, dzhz with dzhz1, fjk with fjk4
sele 1
enddo && Seek fz In welroutnew.txt
use
sele 3
use welzmb alias zmb
sele 2
go top
scan all
@ 8,6 say str(recn(),8)+' /'+str(recc(),8)+' '
fzhz1=trim(fzhz)
dzhz1=trim(dzhz)
sele zmb
loca for zmhz=fzhz1 and zmm<>b.fz
if found()
sele 2
repl fz with zmb.zmm
if at(zmb.fj,'HH,CS,SC')>0
repl bdic with '99'
endif
endif
sele zmb
loca for zmhz=dzhz1 and zmm<>b.dz
if found()
sele 2
repl dz with zmb.zmm
if at(zmb.fj,'HH,CS,SC')>0
repl bdoc with '99'
endif
endif
sele 2
bdic1=subs(fjk,2,2)
bdoc1=subs(fjk,9,2)
if empty(bdoc1) and empty(bdoc)
bdoc1=bdic1
endif
if subs(fz,3,1)='Q' and empty(bdic1)
bdic1='99'
endif
if subs(dz,3,1)='Q' and empty(bdoc1)
bdoc1='99'
endif
if empty(bdic)
repl bdic with bdic1
endif
if empty(bdoc)
repl bdoc with bdoc1
endif
if subs(fz,3,1)<>'Q' and empty(bdic)
*repl bdic with 'oo'
endif
if subs(dz,3,1)<>'Q' and empty(bdoc)
*repl bdoc with 'oo'
endif
if subs(fz,3,1)='Q' and bdic=bdoc
*repl bdic with '99'
endif
if subs(dz,3,1)='Q' and bdic=bdoc
*repl bdoc with '99'
endif
sele 2
fz1=fz
dz1=dz
sele 2
scat to memovar
sele zmb
loca for zmb.zmhz=fzhz1 and zmb.zmm<>b.fz
if found()
sele 2
inse blank
gath from memovar
repl fz with zmb.zmm
endif
sele 2
scat to memovar
sele zmb
loca for zmb.zmhz=dzhz1 and zmb.zmm<>b.dz
if found()
sele 2
inse blank
gath from memovar
repl dz with zmb.zmm
endif
if 1=1
sele 2
scat to memovar
sele zmb
loca for zmb.zmm=b.fz and zmb.zmhz<>b.fzhz
if found()
sele 2
inse blank
gath from memovar
repl fzhz with zmb.zmhz
endif
sele 2
scat to memovar
sele zmb
loca for zmb.zmm=b.dz and zmb.zmhz<>b.dzhz
if found()
sele 2
inse blank
gath from memovar
repl dzhz with zmb.zmhz
endif
sele 2
scat to memovar
sele zmb
loca for zmb.zmm=fz1 and zmb.zmhz<>fzhz1
if found()
sele 2
inse blank
gath from memovar
repl fz with fz1, fzhz with zmb.zmhz
endif
sele 2
scat to memovar
sele zmb
loca for zmb.zmm=dz1 and zmb.zmhz<>dzhz1
if found()
sele 2
inse blank
gath from memovar
repl dz with dz1, dzhz with zmb.zmhz
endif
endif && appe same zmhz or zmlm
sele 2
endscan
repl fz with 'FGZ' for empty(fz) and fzhz='防城港口'
repl dz with 'FGZ' for empty(dz) and dzhz='防城港口'
repl fz with 'DIQ', bdic with '99' for empty(fz) and fzhz='张家界南'
repl dz with 'DIQ', bdoc with '99' for empty(dz) and dzhz='张家界南'
brow title '分界口太多或太少' for .not.empty(fzhz) and ( len(trim(subs(fjk,1,21)))>15;
or empty(subs(fjk,1,21)) and (subs(fz,3,1)<>'Q' or subs(dz,3,1)<>'Q') )
*repl all cars with 1
copy sdf to rout\welrout0.txt for .not.empty(fzhz) and .not.empty(dzhz)
close all
use txt100
zap
do welroutadd
return
VF下可以用这样的实现!全部导入一个表中!