Revert "cleaner json... i think"

This reverts commit 69f687790590d5cfeef8b28658687dddf42307aa.
This commit is contained in:
Shihaam Abdul Rahman 2024-08-03 02:28:51 +05:00
parent 69f6877905
commit 35c802bf7a
Signed by: shihaam
GPG Key ID: 6DA2E87EBC227636

19
ocr.sh
View File

@ -17,8 +17,23 @@ remarks=$(echo "$raw_text" | grep Remarks | sed 's/Remarks //')
from=$(echo "$raw_text" | grep From | sed 's/From //')
to_name=$(echo "$raw_text"| grep -B1 $to_number | grep -v $to_number)
json='{"Amount":"$amount","Currency":"$currency","Date":"$date $time","From":"$from","referece":"$referece","Remarks":"$remarks","Status":"$status","To":{"Account":"$to_number","Name":"$to_name"}}'
json=$(cat <<EOF
{
"Amount": "$amount",
"Currency": "$currency",
"Date": "$date $time",
"From": "$from",
"referece": "$referece",
"Remarks": "$remarks",
"Status": "$status",
"To": {
"Account": "$to_number",
"Name": "$to_name"
}
}
EOF
)
echo $json #| jq
echo $json | jq
#echo $raw_text
#tesseract $INPUT_IMAGE stdout --psm 6