From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Brendan Halpin Newsgroups: gmane.emacs.help Subject: Re: Adding tab characters Date: Thu, 13 Mar 2008 17:26:22 +0000 Message-ID: <871w6eilhd.fsf@wivenhoe.staff8.ul.ie> References: <7937ec17-984e-4698-bbf1-8feaef2841bc@s37g2000prg.googlegroups.com> Reply-To: brendan.halpin@ul.ie NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1205430110 13997 80.91.229.12 (13 Mar 2008 17:41:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 13 Mar 2008 17:41:50 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 13 18:42:19 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JZrRC-0003Wo-PT for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Mar 2008 18:41:55 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JZrQd-0004ik-Hx for geh-help-gnu-emacs@m.gmane.org; Thu, 13 Mar 2008 13:41:19 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 32 Original-X-Trace: individual.net tLY9xJrR09ld+QZJxVwTUgOFwXGJt3tOgIjS1m2JbVIvjrA8Jy Cancel-Lock: sha1:fpwy8h+IsVO2HipXaKsxrG9oS+0= sha1:mXWW5pjpV7XQPF9WpC0kQ++W6+8= User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.50 (gnu/linux) Original-Xref: shelby.stanford.edu gnu.emacs.help:157005 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:52373 Archived-At: Kerry.Thurber@gmail.com writes: > Hello everyone, > > I'm missing something obvious I think. I want to create a tab > delimited file using emacs. I can do it fine with a keyboard macro, > but I need to make something permanent that others can use. > > (defun CreateTabDelimitedFile() > "Convert JED logs into something Scott can use" > (interactive) > (beginning-of-buffer) > (replace-string ";" "\009") ;tried many other variants > ) > > In place of "\009" I tried ^I, ^Tab, an actual tab, "[tab]" and > everything else I could imagine. Nothing seems to work. Is there a > way to replace a string with a tab character? Is there a way to > replace a string with another string *plus* a tab character? An actual tab should work, but you need to enter it as C-Q TAB as Emacs may enter spaces instead (or indent). However try: (replace-string ";" "\t") \t stands for a literal tab. Brendan -- Brendan Halpin, Department of Sociology, University of Limerick, Ireland Tel: w +353-61-213147 f +353-61-202569 h +353-61-338562; Room F2-025 x 3147 mailto:brendan.halpin@ul.ie http://www.ul.ie/sociology/brendan.halpin.html