-
May 17th, 2021, 12:21 AM
#1
Thread Starter
New Member
[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.
-
May 18th, 2021, 05:47 AM
#2
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|