Skip to content
Discussion options

You must be logged in to vote

If by cmd you refer to windows then

@echo off
deskew -g d file1.png|find "[deg]" > out1.txt
deskew -g d file2.png|find "[deg]" >> out1.txt
type NUL > out2.txt
FOR /F "tokens=1,2* delims=:" %%A in (out1.txt) do echo %%B >> out2.txt

gives me in the out2.txt file

 -0.310
 -0.390

Note I have not tidied up the leading space nor added any other averaging to get perhaps a common value of -0.350
Since cmd has exceptionally poor integer math you need to move decimal points three digits right, do addition and divide by 1000
so in this case roughly we strip the decimal points and any leading zeros and using variables would attempt

setlocal ENABLEDELAYEDEXPANSION
set /A "V1=-310"
set /A "V2=-390"
s…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by galfar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #41 on April 28, 2025 22:48.