help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Help


From: swk
Subject: Re: Help
Date: Fri, 25 Oct 2002 06:45:02 +0900
User-agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0

Thanks I will give it a try.  I've found a DLL that may also do the job.



Jesper Harder wrote:
swk <sunwukong@hananet.net> writes:

  
Each line starts with a modified ISO date    e.g.,   19991203   (YYYYMMDD)

Is there any way to pull the ISO Dates to a file and then append the
equivilant Chinese dates to a file?
    
I don't think there's any predefined functionality for that.  Here's a
suggestion for a way you could implement it.  

Evaluate the following, load the file with the ISO dates in a buffer and
do `M-x jh-iso-to-chinese', which will put the Chinese dates in another
buffer.


(defun jh-iso-to-chinese ()
  (interactive)
  (goto-char (point-min))
  (while (re-search-forward "^\\([[:digit:]]\\{4\\}\\)\\([[:digit:]]\\{2\\}\\)\\([[:digit:]]\\{2\\}\\)" nil t)
    (let ((str (format "%s\n" (calendar-chinese-date-string 
			       (mapcar 'string-to-int 
				       (list (match-string 1) 
					     (match-string 2) 
					     (match-string 3)))))))
    (with-current-buffer (get-buffer-create "*chinese output*")
      (insert str))))
  (switch-to-buffer "*chinese output*"))
  


reply via email to

[Prev in Thread] Current Thread [Next in Thread]