Re: Build line editing into a script

2006-02-17 Thread Jay Savage
On 2/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > I want to learn how to build line editing ability into a homemade perl > script I wrote. > > The script takes in keyboard input and formats it, also adding > specific lines to the beginning and end. Making inpu

Build line editing into a script

2006-02-17 Thread reader
I want to learn how to build line editing ability into a homemade perl script I wrote. The script takes in keyboard input and formats it, also adding specific lines to the beginning and end. Making input into a blerb in a homemade flat database. Nothing complex just markers fore and aft to make

Re: In line editing? Streaming through perl directly into another app?

2002-02-28 Thread Randal L. Schwartz
> "Steven" == Steven M Klass <[EMAIL PROTECTED]> writes: Steven> Open file open FILE, " Start tool open TOOL, "|my_tool with params here" or die; Steven> Read line by line, edit as neccessary while () { s/this/that/; Steven> Feed line by line my data into the tool print TOOL $_; }

In line editing? Streaming through perl directly into anotherapp?

2002-02-28 Thread Steven M. Klass
Hi all Ok, my tool is comming along nicely, but here is where I am stuck at. I currently am opening a file and reading the contents. Then I open a second file, where I put my modification to the first file. Then this file is fed to the destination tool. I think this is a BIT redunda

Re: In-line editing..

2002-02-07 Thread Jon Molin
"Steven M. Klass" wrote: > > Hi all, > > Here is the general problem. I have a file that I need to edit but can't. im not sure i follow you here, making a backup copy is not an option? perl -pi.bak -e 's/foo/bar/g' weird_uneditable_file;some_app weird_uneditable_file;mv weird_uneditab

Re: In-line editing..

2002-02-06 Thread John W. Krahn
"Steven M. Klass" wrote: > > Hi all, > > Here is the general problem. I have a file that I need to edit but can't. > That file is then fed into another program. Think of the file that I want to > edit is like a makefile, that I want to use after I tweak it a bit. The > general idea wo

In-line editing..

2002-02-06 Thread Steven M. Klass
Hi all, Here is the general problem. I have a file that I need to edit but can't. That file is then fed into another program. Think of the file that I want to edit is like a makefile, that I want to use after I tweak it a bit. The general idea would be: 1) Find out what needs to be

Re: line editing

2001-09-20 Thread reg . smith
kl y Hope this help Best wishes Reg > Subject: line editing > Date: Wed, 19 Sep 2001 09:30:14 -0700 > From: "Chia Teng" <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > > I have a huge file containing the following patterns to be deleted: > > .

Re: line editing

2001-09-19 Thread Michael Fowler
On Wed, Sep 19, 2001 at 09:30:14AM -0700, Chia Teng wrote: > I have a huge file containing the following patterns to be deleted: [snip] > Is there a better way to do this in perl ? A better way? You didn't describe a way to do it in Perl, and your vi solution wouldn't work in Perl, for what shou

line editing

2001-09-19 Thread Chia Teng
I have a huge file containing the following patterns to be deleted: .SUBCKT AA 5 lines .ends AA .SUBCKT BB 6 lines .ends BB . . . In vi it's easy to "search and delete" them. e.g. by /^\.SUBCKT AA/;/^\.ends AA/d Is there a better way to do this in perl ?