Results 1 to 2 of 2

Thread: [RESOLVED] For all files in directory: Delete everything before a given token

  1. #1

    Thread Starter
    New Member
    Join Date
    Oct 2012
    Posts
    6

    Resolved [RESOLVED] For all files in directory: Delete everything before a given token

    Like the title says. What would be the simplest way to go through every file in a given directory and remove all contents prior to a given token string? I can do this for a given block of text, but I'm not really sure how to do it with file contents short of reading the entire contents of the file to a variable. The files are 5 to 15kb in length, so it's possible. I'm just wondering how it can be done without having to do that. Or is it only possible to read the file contents until I find the token and then copy the following contents to a new file, delete the old, and rename the new?

    Thanks.

    EDIT: I figured out how to do it in Windows PowerShell, so I no longer need this. Thanks anyway!
    Last edited by darxide; May 17th, 2021 at 01:10 AM.

  2. #2
    Frenzied Member
    Join Date
    Feb 2003
    Posts
    1,807

    Re: [RESOLVED] For all files in directory: Delete everything before a given token

    Out of curiousity, if you're using PowerShell, was this even a vb.net question to begin with?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width