From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: swk Newsgroups: gmane.emacs.help Subject: Re: Help Date: Fri, 25 Oct 2002 06:45:02 +0900 Sender: help-gnu-emacs-admin@gnu.org Message-ID: <3DB869DE.9010209@hananet.net> References: <3DB261D7.5060306@hananet.net> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------080208080304010904070808" X-Trace: main.gmane.org 1035496989 30251 80.91.224.249 (24 Oct 2002 22:03:09 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 24 Oct 2002 22:03:09 +0000 (UTC) Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 184q4J-0007rc-00 for ; Fri, 25 Oct 2002 00:03:07 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10) id 184q2c-0003Sl-00; Thu, 24 Oct 2002 18:01:22 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!logbridge.uoregon.edu!news-hub.kaist.ac.kr!feeder.kornet.net!newsfeed.hananet.net!news.hananet.net!not-for-mail User-Agent: Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en, zh, zh-cn, zh-tw, ja Original-Newsgroups: gnu.emacs.help Original-Lines: 102 Original-NNTP-Posting-Host: 218.237.82.238 Original-X-Trace: news.hananet.net 1035495902 218.237.82.238 (Fri, 25 Oct 2002 06:45:02 KST) Original-NNTP-Posting-Date: Fri, 25 Oct 2002 06:45:02 KST Original-Xref: shelby.stanford.edu gnu.emacs.help:106356 Original-To: help-gnu-emacs@gnu.org Errors-To: help-gnu-emacs-admin@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.0.11 Precedence: bulk List-Help: List-Post: List-Subscribe: , List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: Xref: main.gmane.org gmane.emacs.help:2906 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:2906 --------------080208080304010904070808 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Thanks I will give it a try. I've found a DLL that may also do the job. Jesper Harder wrote: >swk 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*")) > > --------------080208080304010904070808 Content-Type: text/html; charset=us-ascii Content-Transfer-Encoding: 7bit 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*"))
  

--------------080208080304010904070808--