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

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
autonicknan
Posts: 19
Joined: 01 Mar 2013 11:44

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

#1 Post by autonicknan » 25 Sep 2014 04:59

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

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

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

#2 Post by foxidrive » 25 Sep 2014 05:09

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.

autonicknan
Posts: 19
Joined: 01 Mar 2013 11:44

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

#3 Post by autonicknan » 25 Sep 2014 05:29

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

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

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

#4 Post by Squashman » 25 Sep 2014 06:30

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! :?:

autonicknan
Posts: 19
Joined: 01 Mar 2013 11:44

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

#5 Post by autonicknan » 25 Sep 2014 10:07

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

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

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

#6 Post by foxidrive » 25 Sep 2014 10:18

Why are you using more on a binary file though? What's the purpose of running a JPG file through more?

autonicknan
Posts: 19
Joined: 01 Mar 2013 11:44

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

#7 Post by autonicknan » 25 Sep 2014 11:08

I want to extract some info about the photo like the date/time taken and the brand/model of the camera...

dbenham
Expert
Posts: 2461
Joined: 12 Feb 2011 21:02
Location: United States (east coast)

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

#8 Post by dbenham » 25 Sep 2014 11:17

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.

foxidrive
Expert
Posts: 6031
Joined: 10 Feb 2012 02:20

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

#9 Post by foxidrive » 25 Sep 2014 11:31

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.

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

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

#10 Post by Squashman » 25 Sep 2014 11:34

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!

npocmaka_
Posts: 512
Joined: 24 Jun 2013 17:10
Location: Bulgaria
Contact:

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

#11 Post by npocmaka_ » 25 Sep 2014 11:35

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/

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

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

#12 Post by Squashman » 25 Sep 2014 12:05

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

Squashman
Expert
Posts: 4465
Joined: 23 Dec 2011 13:59

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

#13 Post by Squashman » 25 Sep 2014 12:15

exiftool looks to be really nice. You can specify which tags you want to extract.
http://www.sno.phy.queensu.ca/~phil/exiftool/

Post Reply