I pipe those results to my REPL utility and preserve only the desired token. I use FINDSTR to filter out the lines that don't meet the template of at least 2 space delimted tokens prior to (xfer#. The utility makes the solution very simple. It is an amazingly useful utility, despite not requiring much code. I have written a hybrid JScript/Batch utility script named "REPL.BAT" that performs regex search and replace. I'm hoping that you may use JScript, since it is native to Windows. I am assuming you are restricted to commands that are native to Windows - no downloaded executables. I suppose it can be done using native batch commands, but that is a nasty problem. One method to prevent this is to strip out the quotations before the for loop with set Line=%Line:"=%.īased on your comment to David Ruhmann's answer, you want the token that is 2 positions before the (xfer# string. Lines containing an odd number of double quotation marks " will cause the script to crash.Setlocal EnableExtensions EnableDelayedExpansion for /f "tokens=2 delims=:" %%A in ("line") do (įor /f "tokens=2" %%B in ("%%A") do echo %%BĮxtract the second token before the last colon. for /f "tokens=3" %%A in ("line") do echo %%AĮxtract the second token delimited by single line whitespace from the second token delimited by colons from the line. From there it is just a matter of using those anchors to determine the token position.Įxtract the third token delimited by single line whitespace from the line. This allows us to know that there are constant delimiters in the line. Assuming the more complete regex for the line looks like this \(xfer#\d , to-check=\d /\d \). It sounds like you just need to perform a token grab from the lines. All in all, HaoZip packs some powerful features for an archive manager and can be easily figured out by users of any experience level, thanks to its intuitive features.Do note that batch is not the best language to use for regex! Cmd processes the input one line at a time, whereas regex allows for multi-line processing. The compression tool requires a moderate amount of system resources, has a good response time, supports keyboard shortcuts and quickly finishes a task. HaoZip comes with some additional functions which allow you to view and convert image files, calculate MD5 checksums, batch-rename items and batch-replace strings, scan files for Trojans and open virtual CDs.įrom the 'Settings' section you can select the compression and decompression mode (smart or full-speed mode), integrate HaoZip into shell and make it stay on top of other apps, set archive associations, customize the appearance, as well as specify the default text and image viewer, just to name a few. Plus, you can disable the double-panel, convert archives to SFX, view a log file, import and export settings, repair archives, change the interface language and organize profiles. Other features HaoZip revolve around archive encryption, file exclusions, the compression algorithm, time and comments. delete files after archiving, test archived items, turn off the computer on completion, compress and send via email). add and replace files, synchronize archive contents), split the archive to volumes by size, and configure archiving options (e.g. ZIP, 7Z, TAR, WIM, LZH) and compression method (ranging from 'Store' to 'Best').įurthermore, you can select the update mode (e.g. Thanks to the Explorer-based layout, you can easily locate and access items for processing, after viewing their name, size, type and date of modification.Ĭreating an archive can be seamlessly done by specifying a name, format (e.g. The app is wrapped in a clean and intuitive interface. Similar to WinRar and WinZip, HaoZip is a powerful tool designed to help you extract content from archives and compress files while optimizing size.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |