[PLUG] Perl: deleting text - more clarification

Michael Rasmussen mikeraz at patch.com
Wed Feb 4 06:27:02 UTC 2004


On Tue, Feb 03, 2004 at 08:05:47PM -0500, Brian Derr wrote:
> 
> It is formatted like so:
> 
>   <Timestamp>
>   text ....
>   (there is no set number of lines, it could be from 1 to really big ;-)
> 
> So, what I want to happen is to take a record from file A and move it to
> file B.  But have it removed from file A so that the next record is
> bumped up to where the record that just got moved used to be.  Possible?
> 

To be sure we understand what you're doing I'm offering up this explanation
for you to verify or correct.

  Some process writes to FileA, records are 
    <timestamp><NewLine><DataOfInterest><EmptyLine>

  Later on you'll read FileA, note that there is something in <DataOfInterest>
  that indicates the current record should move to FileB, write that record
  to FileB and remove it from FileA.

If that's true then questions need asking:

  Is there any chance that <DataOfInterest> will contain blank lines and/or
  timestamps?

  What prevents the data from being filtered in the first place and put into
  FileA or FileB as necessary?

  Is FileA being written with new records on a continuous basis?  i.e. are 
  you blocked from putting a lock on it to do an edit in place?


-- 
      Michael Rasmussen  aka  mikeraz
    Be appropriate && Follow your curiosity
 http://www.patch.com/ http://meme.patch.com/
   Get Fixed:  http://www.dampfixie.org
   The fortune cookie says:
All diplomacy is a continuation of war by other means.
		-- Chou En Lai





More information about the PLUG mailing list