Jump to content


  • Content Count

  • Joined

  • Last visited

  • Donations


Community Reputation

2 Neutral

About radix

Contact Methods

  • Website URL

Profile Information

  • OS
    Windows 8 x64

Recent Profile Visitors

2,637 profile views
  1. I use Ubuntu. But how to write the command to process all files with this base name: file.partxx.rar? I tried this: for i in "file*"; do truncate --s +1 "file*"; done which generate a file called file* with 1 byte size. With sed was easy, but it's slow. I succeeded with this: for i in file.part*.rar; do truncate -s +1 file.part*.rar; done Actually, the above command adds 5 bytes to the eof. I used a wrong wild card for this command. Thanks!
  2. Hi, I have a number of splitted rar files, eg.: file.part01.rar file.part02.rar . . . file.partxx.rar I need to add one 0 or NULL character at the end of every file. I used the next command: for i in "file*"; do sed -i '$s/$/0/' $i; donebut it's slow for large files (it read all content of files). I tried to add the character NULL on those files with dd, but it works for one file/command line and I can't find a way to use wildcard with dd: dd if=/dev/zero bs=1 count=1 >> 'file.part01.rar'dd command works instantly even for a file with 1 GB size. I need a command or a bash script that wil
  3. Running @ECHO OFFSETLOCAL ENABLEEXTENSIONSSET "FS=files*.7z.*"SET "WD=D:\New folder"SET "RS=?SHA1"FOR /F "DELIMS=*" %%A IN ("%FS%") DO SET "FN=%%A">"%WD%\%FN%.sha1" TYPE NULFOR /F "TOKENS=*" %%A IN ('FSUM.EXE -SHA1 -D"%WD%" "%FS%"') DO (SET "OL=%%A" >>"%WD%\%FN%.sha1" CALL ECHO;%%OL:%RS%=%%)it will create an output like this: 6ea15a475e8ab4db5769b3e37601a368834becb1 *files.7z.00159cf9224f46d5967d76a204e0d823f2d6e5f562e *files.7z.002I've changed the output file path to folder where 7-Zip archives are located (working directory). Thanks! It's possible to write this entire batch script
  4. Thanks for the tip! For recursive find and replace string in multiple files: SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSIONSET New_string=new stringSET Old_string=old stringFOR /F "tokens=* delims=" %%A IN ('DIR /B /S *.txt') DO echo Processing %%A...&CALL :do_replace "%%A"GOTO :EOF:do_replaceIF EXIST "%~dpnx1.new" DEL "%~dpnx1.new"SET tomod=0FOR /F "tokens=* delims=" %%B IN ('TYPE "%~dpnx1"^|FIND "%Old_string%"') DO SET tomod=1&GOTO :outofloop:outofloopIF %tomod%==0 ECHO No match...&ECHO.&GOTO :EOFFOR /F "tokens=* delims=" %%B IN ('TYPE "%~dpnx1"') DO (SET Line=%%BSET ModLin
  5. Computing SHA-1 sums is a little bit paranoid. md5 is enough secure. I compute SHA-1, because my machine is loaded up to 16% during hash calculation, which is fine. The HDD is loaded at its maximum read speed during hash computing which means that if I calculate md5 sums instead of sha-1, it will require the same amount of time. In this case a faster storage is needed to finish calculation faster. Almost all hash command line utilities, except for exactfile can max out the read speed of a HDD. AutoIt _Crypt_HashFile function is on the limit, with 175 MB/s (on a RAID0 SSD array), but it's not e
  6. SHA-1 is compromised too, so we should use SHA-512, but that will require a completely new batch script.
  7. I skipped fciv. I remove only ?SHA1 to look like checksum files generated by HashCheck Shell Extension. Thanks!
  8. I want to remove the ?SHA1 string, but I thought on using a second variable leaved blank, like in an example from stackoverflow.com. The code from the top of the batch file: SET WD=D:\New folderfsum.exe -sha1 -d"%WD%" "files*.7z.*">"%WD%\files.txt" & findstr /v ";" "%WD%\files.txt">"%WD%\files.sha1" & del /f /q "%WD%\files.txt"fsum.exe -sha1 -d"%WD%" "files1234*.7z.*">"%WD%\files1234.txt" & findstr /v ";" "%WD%\files1234.txt">"%WD%\files1234.sha1" & del /f /q "%WD%\files1234.txt"calculate the sha-1 sum for the given sets of files and remove the unwanted lines from t
  9. I wanted to remove ?SHA1 from the output file and jaclaz script did it.
  10. Thanks jaclaz for the neat script! Thanks Yzöwl for creating the new thread! I want to replace some unwanted characters from an output file that contains hashes for a group of big files. I used fsum hash utility. Usually, the output looks like this: ; SlavaSoft Optimizing Checksum Utility - fsum 2.52.00337 <www.slavasoft.com>;; Generated on 03/29/15 at 20:45:38 ;778e7656fa79a073adbee3be578b50e8c58e7f5a ?SHA1*files.7z.001860993761f8420c84430d945b4f31379f49bc2f7 ?SHA1*files.7z.002ef996f72db0131b9983fb0f18f823a81418b34cc ?SHA1*files.7z.003so, it's need some cleaning. I used a command l
  11. Hello, It's not working, runing the test in a virtual machine generate file content like this one: ALLUSERSPROFILE=C:\Documents and Settings\All UsersAPPDATA=C:\Documents and Settings\Power User\Application DataCLIENTNAME=ConsoleCommonProgramFiles=C:\Program Files\Common FilesCOMPUTERNAME=POWERUSER-PCComSpec=C:\WINDOWS\system32\cmd.exeDEVMGR_SHOW_DETAILS=DEVMGR_SHOW_NONPRESENT_DEVICES=1FP_NO_HOST_CHECK=NOHOMEDRIVE=C:HOMEPATH=\Documents and Settings\Power UserLOGONSERVER=\\POWERUSER-PCnew=news tringNUMBER_OF_PROCESSORS=1old=XX XXOS=Windows_NTPath=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System
  12. Hello, I got a similar problem with the next batch script, trying to replace a string with another one in multiple files: @ECHO OFFSETLOCALfor %%* in (.) do set new=%%~n*SET "new=news tring"SET "old=XX XX"for %%f in (*.txt) do ( echo Processing %%f... ( FOR /F "delims=" %%l IN (%%f) DO ( SET "line=%%l" SETLOCAL ENABLEDELAYEDEXPANSION set "x=!line:%old%=%new%!" ECHO(!x! ENDLOCAL ) )>%%~nf.new)::for %%f in (*.new) do move /y "%%f" "%%~nf.txt"GOTO :EOFFiles that contain spaces in their names will not be edited. I tried with these lines of code: FOR
  13. Thanks jaclaz to point in the right direction. The working batch script: START /WAIT CMD /C "CD %~dp0Install\Piriform_CCleaner_5.1.5075_x86_^&_x64 & Piriform_CCleaner_5.1.5075_x86_^&_x64.cmd"
  • Create New...