NTS Forums
Home
Help
Search
Login
Register
Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News:
Welcome to the Newtek Technology Services Forum!
NTS Forums
»
Programming/Design
»
Perl Forum
»
Reduce size of opened file.
« previous
next »
Print
Pages: [
1
]
Go Down
Author
Topic: Reduce size of opened file. (Read 4821 times)
yanosh
Newbie
Posts: 1
Karma: +0/-0
Reduce size of opened file.
«
on:
August 18, 2009, 08:59:29 AM »
Hi,
How can I reduce file size, when the the file is opened ? I found "trucate" command, but I want reduce file from beginning or delete specific numbers of line.
Please help !
Yanosh
Logged
jbcampos [CT]
CrystalTech
Jr. Member
Posts: 150
Karma: +13/-0
Re: Reduce size of opened file.
«
Reply #1 on:
March 30, 2010, 05:36:33 PM »
You will probably want to read the file contents into an array, remove the lines you want or split the array then rewrite then back into the file. There are probably easier ways but that's one method that comes to mind.
I realize this is an older post but figured i'd shoot an answer out anyway in case anyone was running into the same issue.
Logged
Joseph Campos
Server Operations
Toll Free: 1-877-323-4678
Phone: 602-263-0300 Opt. #4
Print
Pages: [
1
]
Go Up
« previous
next »
NTS Forums
»
Programming/Design
»
Perl Forum
»
Reduce size of opened file.