Article View: gnu.misc.discuss
Article #2154Re: A very simple question on SED or AWK for a GURU, possibly a lisp script or emacs batch processing of many files
From: Friedrich Dominicus
Date: Tue, 14 Jan 2003 10:23
Date: Tue, 14 Jan 2003 10:23
38 lines
2679 bytes
2679 bytes
gnuist006@hotmail.com (gnuist006) writes:
>
> Mr Friedrich's reply uses perl.
Definitly not. It's Common Lisp.
>
> On the other hand for a lisp based solution
> I CAN write a macro or a lisp function to do the
> core logic in lisp inside emacs by myself using narrow
> and widen or transient mode. But here what I do not know
> is how to load one file after another and then save it
> to a new name and close that buffer. Please just show me
> how to do a bunch of files in this way. I can generate the
> file names like this in bash:
Well extending my solution to more files is easy
(mapc '#(lambda (file) (q-2003-01-14 file)
;; rename the generated file if needed)
(directory "pattern"))
That's all
Doing that all in Emacs Lisp isn't much more difficult.
>
> for i in `du -a directory | grep file.txt | sed to remove some junk
> from du`; do
For getting a file listing in Common Lisp use directory in Emacs Lisp
it's directory-files.
But I *strongly* sugggest you post there where you expect an
answer. Is it a shell problem use some .shell group if it's Emacs Lisp
use some emacs Newgroup and if you want Common Lisp post here.
Friedrich
Technical Details
Message-ID:
<874r8cjagx.fsf@fbigm.here>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!newsfeed.hanau.net!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mailReferences:
<b00bb831.0301131603.34e9704c@posting.google.com> <b00bb831.0301140042.4dff4b4e@posting.google.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1025b4,1e8c4b23af1e4636 X-Google-Attributes: gid1025b4,public X-Google-Thread: f4fd2,1e8c4b23af1e4636 X-Google-Attributes: gidf4fd2,public X-Google-Thread: 103b8b,1e8c4b23af1e4636 X-Google-Attributes: gid103b8b,public X-Google-Thread: 1012a6,6b5030ec1bcea943 X-Google-Attributes: gid1012a6,public X-Google-ArrivalTime: 2003-01-14 02:22:03 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!newsfeed.hanau.net!newsfeed01.sul.t-online.de!newsmm00.sul.t-online.com!t-online.de!news.t-online.com!not-for-mail From: Friedrich Dominicus <frido@q-software-solutions.com> Newsgroups: gnu.misc.discuss,comp.lang.lisp,gnu.emacs.help,comp.unix.shell Subject: Re: A very simple question on SED or AWK for a GURU, possibly a lisp script or emacs batch processing of many files Followup-To: comp.lang.lisp Date: 14 Jan 2003 11:23:58 +0100 Organization: Q Software Solutions GmbH Lines: 38 Message-ID: <874r8cjagx.fsf@fbigm.here> References: <b00bb831.0301131603.34e9704c@posting.google.com> <b00bb831.0301140042.4dff4b4e@posting.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: news.t-online.com 1042539603 01 11747 XPR-Ej3TSfYD8O 030114 10:20:03 X-Complaints-To: abuse@t-online.com X-Sender: 320004655587-0001@t-dialin.net User-Agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Military Intelligence)