Page 1 of 1

"more" command is not executed at once in case the file is t

Posted: 25 Sep 2014 04:59
by autonicknan
Hello,

In case I run "more" command for a certain file which is too big, the command is not executed at once but "pressing a button" is needed.
Does anybody know any trip on how to overcome this within a batch file?

Thanks

Best Regards,
Nikos

Re: "more" command is not executed at once in case the file

Posted: 25 Sep 2014 05:09
by foxidrive
With the more command it triggers the pause every 64K lines.

What do you need to do? If you explain the task then someone may have a workaround.

Re: "more" command is not executed at once in case the file

Posted: 25 Sep 2014 05:29
by autonicknan
Actually, what I am doing is to run more command for a JPG file which is more than 6 Kbytes. When I run it, the 41% of more command is executed and it is demanded to press a button in order to continue with the running of the command.

What I need is to use this command in a batch file but the "press button" action to be executed automatically. This means that the user does not have to press a button.

I hope it is more clear now :)

Thanks

Nikos

Re: "more" command is not executed at once in case the file

Posted: 25 Sep 2014 06:30
by Squashman
No. Not really clear at all. Using the MORE command with a JPEG or any other file that isn't a text file really doesn't make any sense at all! :?:

Re: "more" command is not executed at once in case the file

Posted: 25 Sep 2014 10:07
by autonicknan
My code is the below one :

@echo off
cd /d "%~dp0"

for %%b in (DSF_5105_nikon.jpg) do (

more %%b > %%b.txt

)

pause



The DSF_5105_nikon.jpg has 6.6 MB size. As a result the more command cannot be executed at once and the -- More (41%) -- is displayed at the bottom of %%x.txt which means that the user must press a key on the keyboard.

What I need is this action(key press) to be done automatically which means that user does not have to press any key

Thanks
Nikos

Re: "more" command is not executed at once in case the file

Posted: 25 Sep 2014 10:18
by foxidrive
Why are you using more on a binary file though? What's the purpose of running a JPG file through more?

Re: "more" command is not executed at once in case the file

Posted: 25 Sep 2014 11:08
by autonicknan
I want to extract some info about the photo like the date/time taken and the brand/model of the camera...

Re: "more" command is not executed at once in case the file

Posted: 25 Sep 2014 11:17
by dbenham
Why do you think passing the .jpg file through MORE will help you extract that information :?:
I don't see how that could help, even if you could avoid the pause at 64k lines.

Re: "more" command is not executed at once in case the file

Posted: 25 Sep 2014 11:31
by foxidrive
autonicknan wrote:I want to extract some info about the photo like the date/time taken and the brand/model of the camera...


Use an EXIF command line tool to give you the information.

Re: "more" command is not executed at once in case the file

Posted: 25 Sep 2014 11:34
by Squashman
autonicknan wrote:I want to extract some info about the photo like the date/time taken and the brand/model of the camera...

Then use an EXIF extraction program!

Re: "more" command is not executed at once in case the file

Posted: 25 Sep 2014 11:35
by npocmaka_
forget about more.
If (IF because mspaint does not set any metadata for instance , some other tools do , but it's not mandatory ) there is some metadata in the jpg files you try to extract it with strings ->http://technet.microsoft.com/en-us/sysinternals/bb897439.aspx


the ultimate tool for processing images trough command line is imagemagick - http://www.imagemagick.org/

Re: "more" command is not executed at once in case the file

Posted: 25 Sep 2014 12:05
by Squashman
Some nice vbscripts over here.
I am sure they could be converted to dump the output to a text file instead of the screen or even parse the output with the FOR /F command.
http://www.jsware.net/jsware/scrfiles.php5#jpginf

Re: "more" command is not executed at once in case the file

Posted: 25 Sep 2014 12:15
by Squashman
exiftool looks to be really nice. You can specify which tags you want to extract.
http://www.sno.phy.queensu.ca/~phil/exiftool/