[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] deleting a line again



No, it is not.  You will have to re-write the whole file.  This is a
function of the file system (i.e., of any file system).  A file is nothing
but a series of blocks of bytes--usually contiguous but depends on file
system. Files are not made of lines, words, paragraphs, or anything of the
kind. These are items only understood by humans. Perl can guess what a line
is based on an assumption of a character that identifies the end of a line
(i.e. line-break).

-K

"A foolish consistency is the hobgoblin of little minds"

> From: george rosenberg <ghrose@unm.edu>
> Date: Tue, 8 Feb 2000 15:36:13 -0800
> To: macperl@macperl.org
> Subject: [MacPerl] deleting a line again
> 
> 
> 
> let me explain further, what I am probably trying to ask:
> almost always, the line i want to remove is the first line in the
> file and it begins with a ">".
> i want to remove this line and then close the file.
> 
> is it possible to do this? is there a delete line command, that will
> remove the line and not leave a empty line behind?
> 
> thanks
> 
> 
> 
>>> i would like to use Macperl to remove a single line from a "big
>>> bunch" of files without leaving a blank line behind.  is it possible
>>> to do this without rewriting the whole file? is there a command or
>>> short code that can do this once the line has been indentified?
>> 
>> Sorry, no, that's not how file systems work (When I was young, even
>> the concept
>> of being able to jump to an arbitrary position in an open file was
>> revolutionary :-)
>> 
>> Matthias
>> 
>> --
>> Matthias Neeracher   <neeri@iis.ee.ethz.ch>
>> http://www.iis.ee.ethz.ch/~neeri
>> "And that's why I am going to turn this world upside down, and make
>> of it a fire so *bright* that someone real will notice"
>> -- Vernor Vinge, _Tatja Grimm's World_
> 
> -- 
> 
> # ===== Want to unsubscribe from this list?
> # ===== Send mail with body "unsubscribe" to macperl-request@macperl.org
> 


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org