🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.misc.discuss
Article #2153

Re: A very simple question on SED or AWK for a GURU, possibly a lisp script or emacs batch processing of many files

#2153
From: gnuist006
Date: Tue, 14 Jan 2003 08:42
50 lines
2797 bytes
The main group for followup to this is: comp.unix.shell
or gnu.emacs.help depending on the type of solution.
I hope that I have the relevant groups for cross-posting.
----

Even though the problem posed in this thread is still

*** UNSOLVED ***

let me extend my gratitude to Mr Christofer and Friedrich
for their kind attempts to answer this. I hope for some
more help tonight.

Mr Friedrich's reply uses perl. I am not familiar with
this language. Also I prefer not to generate very many 
intermediate files since I have to process a large number
of them. I also want to use bash/sed/awk instead of
perl.

I can write a bash wrapper loop but what I do not know
here is how to implement the core logic of replacing an
indefinite number of forward-slashes within a pattern
of interest.



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:

for i in `du -a directory | grep file.txt | sed to remove some junk from du`; do

core logic

done


Thanks a lot and do not forget to have fun working on
this problem. It is a little out of the way.

Gnuist


BTW there is a disjoint thread on this subject in comp.unix.shell
and there have been no useful replies as you can see.
Technical Details
Message-ID: <b00bb831.0301140042.4dff4b4e@posting.google.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
References: <b00bb831.0301131603.34e9704c@posting.google.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f4fd2,1e8c4b23af1e4636
X-Google-Attributes: gidf4fd2,public
X-Google-Thread: 1025b4,1e8c4b23af1e4636
X-Google-Attributes: gid1025b4,public
X-Google-Thread: 1012a6,6b5030ec1bcea943,start
X-Google-Attributes: gid1012a6,public
X-Google-Thread: 103b8b,1e8c4b23af1e4636
X-Google-Attributes: gid103b8b,public
X-Google-ArrivalTime: 2003-01-14 00:42:06 PST
Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail
From: gnuist006@hotmail.com (gnuist006)
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
Date: 14 Jan 2003 00:42:05 -0800
Organization: http://groups.google.com/
Lines: 50
Message-ID: <b00bb831.0301140042.4dff4b4e@posting.google.com>
References: <b00bb831.0301131603.34e9704c@posting.google.com>
NNTP-Posting-Host: 209.178.179.185
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
X-Trace: posting.google.com 1042533726 7080 127.0.0.1 (14 Jan 2003 08:42:06 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: 14 Jan 2003 08:42:06 GMT