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
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
Steven == Steven M Klass [EMAIL PROTECTED] writes:
Steven Open file
open FILE, incoming or die;
Steven Start tool
open TOOL, |my_tool with params here or die;
Steven Read line by line, edit as neccessary
while (FILE) {
s/this/that/;
Steven Feed line by line my data into the tool
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
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
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 would be:
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:
.SUBCKT AA
5 lines
.ends AA
.SUBCKT BB
6 lines
.ends BB
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