Reputation: 31
I have two text file : aa.txt and bb.txt Content of aa.txt is :
======= TOTAL AMOUNT 5937456 =========
======= TOTAL AMOUNT 5564789 =========
Content of bb.txt is :
======= TOTAL AMOUNT 857439898 =========
======= TOTAL AMOUNT 556443789 =========
Now I want to copy only integer part eg : 5937456,857439898 etc from the above text files to excel sheet. Can anyone help me?? Thanks
Upvotes: 1
Views: 191
Reputation: 57252
Not tested:
for /f "tokens=3 delims== " %%a in ('type aa.txt^|find /i "TOTAL AMOUNT"') do (
echo %%a
set /a the_number=%%a
)
For the copying to excel you'll need jscript/vbscript/powershell. Or you can output the number s in CSV and open it with excel.
Upvotes: 1