NTS Forums

Please login or register.

Login with username, password and session length
 

News:

Welcome to the Newtek Technology Services Forum!


Author Topic: Reduce size of opened file.  (Read 4821 times)

Offline 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

Offline jbcampos [CT]

  • CrystalTech
  • Jr. Member
  • *****
  • Posts: 150
  • Karma: +13/-0
    • CrystalTech Web Hosting, Inc.
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.
Joseph Campos
Server Operations
Toll Free: 1-877-323-4678
Phone: 602-263-0300 Opt. #4