Skip to content
View in the app

A better way to browse. Learn more.

ResHax

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.
Help us keep the site running.

Batch file trimming?

Featured Replies

  • Author
  • Localization

Doctor Loboto, posted Mon Oct 17, 2016 6:33 am (18104)


Hey all, I was hoping someone could help me with a little issue I've been having. I have over 200 files, and I want to trim them all up to the first appearance of a specific string. I need a batch file for command prompt, or even quickbms, to do this preferably.
Basically I want to do this for all files.

Go from
"miscellaneousclutterCTPKfollowed"
to
"CTPKfollowed"

Essentially I want to delete everything in the file BEFORE the string "CTPK" appears.

Can anyone help?
  • Author
  • Localization

aluigi, posted Mon Oct 17, 2016 11:09 am (18113)


something like this, probably you want to "work" on the NAME variable:
Code:
findloc OFFSET binary "CTPK"
get SIZE asize
math SIZE - OFFSET
get NAME filename
log NAME OFFSET SIZE
  • Author
  • Localization

Doctor Loboto, posted Mon Oct 17, 2016 1:25 pm (18115)


All right, that works. Thanks much. On a minor addendum to this, how would one go about specifying that the SECOND occurrence of a string is the one that needs to be trimmed to? For example:

"miscellaneousdataTGXTmoredataGXTfollowing"
to
"GXTfollowing"?
  • Author
  • Localization

aluigi, posted Mon Oct 17, 2016 3:42 pm (18119)


Replace:
Code:
get SIZE asize
with
Code:
goto OFFSET
findloc SIZE binary "THE OTHER PATTERN YOU WANT TO SEARCH"
math SIZE - OFFSET
It's important that the second pattern is different than the first one or you will find it again, if it's the same it's enough to add a "getdstring DUMMY 4" before the above code to skip the first pattern found.
  • Author
  • Localization

Doctor Loboto, posted Mon Oct 17, 2016 3:55 pm (18123)


It doesn't seem to be working. Basically what I need to do is delete everything in the file before the EXACT string "GXT" is found, including the "TGXT" being deleted.
  • Author
  • Localization

Doctor Loboto, posted Thu May 11, 2017 6:24 pm (23123)


Ok, one quick question, how would I go about deleting everything up to and INCLUDING the first "3DS-LZ" in a file?
  • Author
  • Localization

aluigi, posted Thu May 11, 2017 8:00 pm (23131)


Code:
findloc OFFSET string "3DS-LZ"
math OFFSET 6
get SIZE asize
math SIZE - OFFSET
log "new.dat" OFFSET SIZE
Guest
This topic is now closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.