你的要求是两个部分,实际上写excel是很容易的一点,并考虑提供你总是使用C C等它可以做到。
现在想想,如果你只是做一个文本列表(a-1 B-1 B-3 a-2等),你可以取第一个字符,检查它是否是a B C D等,并设置列(asc(text))最后一个数字a-23=23+行偏移量=单元格行,因此如果有一些缺失,将跳过空白。B-23=单元格2,27
多亏了李·麦克,它会给出一个数字作为答案。
- ; use say nth of your list of text selected (setq nthtext (nth x testlist))
- ; to use (setq cellnum (Lm:parsenumbers nthtext))
- ;;-------------------=={ Parse Numbers }==--------------------;;
- ;; ;;
- ;; Parses a list of numerical values from a supplied string. ;;
- ;;------------------------------------------------------------;;
- ;; Author: Lee Mac, Copyright © 2011 - www.lee-mac.com ;;
- ;;------------------------------------------------------------;;
- ;; Arguments: ;;
- ;; s - String to process ;;
- ;;------------------------------------------------------------;;
- ;; Returns: List of numerical values found in string. ;;
- ;;------------------------------------------------------------;;
- (defun LM:ParseNumbers ( s )
- (
- (lambda ( l )
- (read
- (strcat "("
- (vl-list->string
- (mapcar
- (function
- (lambda ( a b c )
- (if
- (or
- (< 47 b 58)
- (and (= 45 b) (< 47 c 58) (not (< 47 a 58)))
- (and (= 46 b) (< 47 a 58) (< 47 c 58))
- )
- b 32
- )
- )
- )
- (cons nil l) l (append (cdr l) (list nil))
- )
- )
- ")"
- )
- )
- )
- (vl-string->list s)
- )
- )
|