本帖最后由 highflybir 于 2011-1-11 10:04 编辑
- (setq f (open "c:/test.txt" "R"))
- (setq l nil)
- (while (setq s (read-line f))
- (setq s (strcat "(" (VL-STRING-SUBST " " "," s) ")"))
- (setq s (read s))
- (apply 'set s)
- (setq l (cons s l))
- )
- (close f)
- (reverse l)
譬如test.txt如下的文字
kg,200.255
km,10000
kl,123214
dg,123551
ek,12
返回:
((KG 200.255) (KM 10000) (KL 123214) (DG 123551) (EK 12))
每个变量都赋值了
|