Jump to content


BankFodder

Minor programming assistance needed

style="text-align:center;"> Please note that this topic has not had any new posts for the last 518 days.

If you are trying to post a different story then you should start your own new thread. Posting on this thread is likely to mean that you won't get the help and advice that you need.

If you are trying to post information which is relevant to the story in this thread then please flag it up to the site team and they will allow you to post.

Thank you

Recommended Posts

It's not really programming – but I'm not sure what to call it.

 

Anyway, I use a printer program which generates a log file. After every print, the log file is overwritten.

 

I want to extract certain information from the log file and put it into an Excel spreadsheet so I can keep track of the prints that I do and the settings are used.

 

I don't want to have to muck around. I want to be able to do it with one click to start the script going.

 

Here is the log file. Most of the information I want is contained in the two lines which I have coloured in red.

 

The data I want is coloured in green. The field names are the word before the = (equals sign)

 

I haven't picked out all the fields or the data in green in the list below – but you get the picture.

 

As to be one click, which then extracts the data and inserts it into the correct fields in the spreadsheet and then saves it down. The first column in the spreadsheet should be the date that it was done.

 

Can anyone help?

 

***** QTRgui Log *****

Version 2.7.0.0

Print by Print Menu/Button

 

".\bin\ImageToRaster.exe" gui 0 0 1 "PPD=Quad1400.PPD PRINTER=Quad1400-HDk6 MediaType=Matte ripFeed=Sheet Pagesize=A4 position=center scale-percent=12 portrait=yes Resolution=2880 ColorModel=QTRIP" "C:\Users\Marc\Desktop\Untitled Export\L1006880.tif"

 

".\bin\QuadToPrinter.exe" gui 0 0 1 "PPD=Quad1400.PPD PRINTER=Quad1400-HDk6 MediaType=Matte ripFeed=Sheet Pagesize=A4 Resolution=2880 RipSpeed=hispeed ColorModel=QTRIP ripCurve1=14xx-SpecEd-UHD-HahnPhoRag ripCurve2=- ripCurve3=- ripBlend1H=100 ripBlend1M=100 ripBlend1S=100 ripBlend2H=0 ripBlend2M=0 ripBlend2S=0 ripBlend3H=0 ripBlend3M=0 ripBlend3S=0 stpDither=Ordered ripGamma=2 ripLimit=m5"

 

".\bin\RawPrint.exe" "1500w BW" - "L1006880.tif"

 

***** ImageToRaster Log *****

Version 2.7.8.0

 

INFO: .\bin\ImageToRaster.exe gui 0 0 1 PPD=Quad1400.PPD PRINTER=Quad1400-HDk6 MediaType=Matte ripFeed=Sheet Pagesize=A4 position=center scale-percent=12 portrait=yes Resolution=2880 ColorModel=QTRIP C:\Users\Marc\Desktop\Untitled Export\L1006880.tif

PPDFILE = .\ppd\Quad1400.PPD

DEBUG: Page = 595x842; 9,9 to 586,833

DEBUG: Searching for profile "2880/Matte"...

INFO: Loading image file...

DEBUG: ImageOpen("C:\Users\Marc\Desktop\Untitled Export\L1006880.tif", 3, 3, 100, 0, 0018F844)

filename is C:\Users\Marc\Desktop\Untitled Export\L1006880.tif, extn is .tifcalling ReadTIFF

TIFFReadDirectory: Warning, C:\Users\Marc\Desktop\Untitled Export\L1006880.tif: wrong data type 1 for "XMLPacket"; tag ignored.

TIFFReadDirectory: Warning, C:\Users\Marc\Desktop\Untitled Export\L1006880.tif: unknown field with tag 34665 (0x8769) encountered.

DEBUG: TIFF resolution = 72.000000x72.000000, units=2

DEBUG: Stored resolution = 72x72 PPI

DEBUG: orientation = top-left

DEBUG: photometric = 2

DEBUG: compression = 1

DEBUG: Creating tile array (14x21)

DEBUG: Created swap file "C:\Users\Marc\AppData\Local\Temp\/2aaee1e5"...

DEBUG: Image size 48.167 x 72.389

DEBUG: Printable size 8.014 x 11.444

DEBUG: Scaled size 5.780 x 8.687

DEBUG: PageSize = [595 842] (8.26 11.69)

DEBUG: cupsWidth = 5770

DEBUG: cupsHeight = 8240

DEBUG: cupsBitsPerColor = 8

DEBUG: cupsBitsPerPixel = 24

DEBUG: cupsBytesPerLine = 17310

DEBUG: cupsColorOrder = 0

DEBUG: cupsColorSpace = 1

DEBUG: img->colorspace = 3

INFO: Formatting page 1...

x=(0,3467) y=(0,5211), temp=(4161,6254)

top: ht=8240, sz=6254, y=993

left: wd=5770, sz=4161, x=19296

bottom: ht=8240, sz=6254, y=993

 

***** QuadToPrinter Log *****

Version 2.7.8.0

 

PPDFILE = .\ppd\Quad1400.PPD

NOTICE: QTR printing to Quad1400-HDk6

NOTICE: QTR using curve file 14xx-SpecEd-UHD-HahnPhoRag

PAGE: 1 1

DEBUG: StartPage...

DEBUG: MediaClass = "Sheet"

DEBUG: MediaColor = ""

DEBUG: MediaType = "Matte"

DEBUG: OutputType = ""

DEBUG: AdvanceDistance = 0

DEBUG: AdvanceMedia = 0

DEBUG: Collate = 0

DEBUG: CutMedia = 0

DEBUG: Duplex = 0

NOTICE: HWResolution = [ 720 720 ]

NOTICE: ImagingBoundingBox = [ 9 9 577 824 ]

DEBUG: InsertSheet = 0

DEBUG: Jog = 0

DEBUG: LeadingEdge = 0

NOTICE: Margins = [ 9 9 ]

DEBUG: ManualFeed = 0

DEBUG: MediaPosition = 0

DEBUG: MediaWeight = 0

DEBUG: MirrorPrint = 0

DEBUG: NegativePrint = 0

DEBUG: NumCopies = 1

DEBUG: Orientation = 0

DEBUG: OutputFaceUp = 0

NOTICE: PageSize = [ 595 842 ]

DEBUG: Separations = 0

DEBUG: TraySwitch = 0

DEBUG: Tumble = 0

NOTICE: cupsWidth = 5770

NOTICE: cupsHeight = 8240

DEBUG: cupsMediaType = 0

DEBUG: cupsBitsPerColor = 8

NOTICE: cupsBitsPerPixel = 24

DEBUG: cupsBytesPerLine = 207720

DEBUG: cupsColorOrder = 0

DEBUG: cupsColorSpace = 8

DEBUG: cupsCompression = 0

DEBUG: cupsRowCount = 0

DEBUG: cupsRowFeed = 0

DEBUG: cupsRowStep = 0

DEBUG: PageSize = 595x842

DEBUG: stp_get_output_to(v) ||

DEBUG: stp_get_driver(v) |escp2-1400|

DEBUG: stp_get_ppd_file(v) ||

NOTICE: stp_get_resolution(v) |2880|

DEBUG: stp_get_media_size(v) ||

DEBUG: stp_get_media_type(v) |Matte|

DEBUG: stp_get_media_source(v) |Sheet|

DEBUG: stp_get_ink_type(v) ||

NOTICE: stp_get_dither_algorithm(v) |Ordered|

DEBUG: stp_get_output_type(v) |4|

NOTICE: QTR w=595 l=9 r=586 h=842 t=833 b=9

NOTICE: QTR w=5770 l=90 r=90 h=8240 t=90 b=90

DEBUG: GIMP-PRINT: Image_height 8240

DEBUG: GIMP-PRINT: Image_width 5770

DEBUG: GIMP-PRINT: Image_width 5770

DEBUG: GIMP-PRINT: Image_height 8240

DEBUG: GIMP-PRINT: Image_width 5770

DEBUG: GIMP-PRINT: Image_height 8240

DEBUG: GIMP-PRINT: Image_height 8240

NOTICE: Starting page 1...

INFO: Printing page 1, 0%

INFO: Printing page 1, 2%

INFO: Printing page 1, 3%

INFO: Printing page 1, 5%

INFO: Printing page 1, 6%

INFO: Printing page 1, 8%

INFO: Printing page 1, 9%

INFO: Printing page 1, 11%

INFO: Printing page 1, 12%

INFO: Printing page 1, 14%

INFO: Printing page 1, 16%

INFO: Printing page 1, 17%

INFO: Printing page 1, 19%

INFO: Printing page 1, 20%

INFO: Printing page 1, 22%

INFO: Printing page 1, 23%

INFO: Printing page 1, 25%

INFO: Printing page 1, 26%

INFO: Printing page 1, 28%

INFO: Printing page 1, 30%

INFO: Printing page 1, 31%

INFO: Printing page 1, 33%

INFO: Printing page 1, 34%

INFO: Printing page 1, 36%

INFO: Printing page 1, 37%

INFO: Printing page 1, 39%

INFO: Printing page 1, 40%

INFO: Printing page 1, 42%

INFO: Printing page 1, 43%

INFO: Printing page 1, 45%

INFO: Printing page 1, 47%

INFO: Printing page 1, 48%

INFO: Printing page 1, 50%

INFO: Printing page 1, 51%

INFO: Printing page 1, 53%

INFO: Printing page 1, 54%

INFO: Printing page 1, 56%

INFO: Printing page 1, 57%

INFO: Printing page 1, 59%

INFO: Printing page 1, 61%

INFO: Printing page 1, 62%

INFO: Printing page 1, 64%

INFO: Printing page 1, 65%

INFO: Printing page 1, 67%

INFO: Printing page 1, 68%

INFO: Printing page 1, 70%

INFO: Printing page 1, 71%

INFO: Printing page 1, 73%

INFO: Printing page 1, 75%

INFO: Printing page 1, 76%

INFO: Printing page 1, 78%

INFO: Printing page 1, 79%

INFO: Printing page 1, 81%

INFO: Printing page 1, 82%

INFO: Printing page 1, 84%

INFO: Printing page 1, 85%

INFO: Printing page 1, 87%

INFO: Printing page 1, 89%

INFO: Printing page 1, 90%

INFO: Printing page 1, 92%

INFO: Printing page 1, 93%

INFO: Printing page 1, 95%

INFO: Printing page 1, 96%

INFO: Printing page 1, 98%

INFO: Printing page 1, 99%

INFO: Finished page 1...

INFO: Ready to print.

 

***** RawPrint Log *****

Version 2.3.0.0

 

 

***** End of Log *****

 


Share this post


Link to post
Share on other sites

By the way, I would expect to pay for this. I'm sure I wouldn't be able to pay the going rate but I would certainly make a gesture of acknowledgement.


Share this post


Link to post
Share on other sites

I suspect (from the .exe in the log, and the path C:\Users\Marc\Desktop\ ) that this is for a Window$ system.

Would it be helpful to stipulate which OS(es) this script needs to run in?

Share this post


Link to post
Share on other sites

Thanks.

Win 7/10


Share this post


Link to post
Share on other sites

Looks like a job for an Excel macro/script. Shouldn't be too difficult to set one up to import the data in to a work sheet.


PLEASE HELP US TO KEEP THIS SITE RUNNING

EVERY POUND DONATED WILL HELP US TO KEEP HELPING OTHERS

 

 

Quote
No... you can't eat my brain just yet. I need it a little while longer.

Share this post


Link to post
Share on other sites

Probably - but it's beyond me.

Also, I don't think a macro which is based upon recording keystrokes would work


Share this post


Link to post
Share on other sites
By the way, I would expect to pay for this. I'm sure I wouldn't be able to pay the going rate but I would certainly make a gesture of acknowledgement.

 

 

There's this guy we know who says he's a programmer, apparently he needs some cash to pay debts off. Believe he may run a Forum elsewhere.

 

:censored:

 

ps - sorry couldn't resist


Please consider making a small donation to help keep this site running

 

[sIGPIC][/sIGPIC]

 

Share this post


Link to post
Share on other sites

Hmmm - let's not start that on this thread!!


Share this post


Link to post
Share on other sites

Twas only a thought. Sure someone will come up with the goods.


Please consider making a small donation to help keep this site running

 

[sIGPIC][/sIGPIC]

 

Share this post


Link to post
Share on other sites

Do you have any issues with running an additional .exe BF?

 

I use a program called "Mouse Recorder Premium", which, despite the name isn't just for the mouse and is free. Available from http://www.mouserecorder.com/

 

Set up with the correct macro (you'd need to experiment to find a set up that words for you) that will open, interrogate & copy the data from the log file, and paste it in to excel.

 

 

And best of all, it won't cost you a penny :thumb:


We could use your help

PLEASE HELP US TO KEEP THIS SITE RUNNING

 

 

Please note that my posts are my opinion only and should not be taken as any kind of legal advice.

 

If I've helped you at all, please feel free to click on the little star under my posts and leave feedback :)

Share this post


Link to post
Share on other sites

No probs with the exe - but I think that the mouse program records keystrokes. It won't look for particular fields, hook them out and them add them to an existing csv file


Share this post


Link to post
Share on other sites

You use the program to open the log file, then use Ctrl F to find the fields you require, the Shift & arrow keys to highlight the area that you want, and then Ctrl C to copy it.

 

Set up an input field on your excel spreadsheet and use Ctrl V to paste the data that was copied from the log file.

 

 

Don't get me wrong, it will take some tweaking (and it's a bit long winded) to get it to do exactly what you want, but it can be done, and once it's set up it's a single keystroke or mouse click to execute it.

 

Download & install it, and I'll email you a file with a sample macro so that you can see what I mean from your example above.


We could use your help

PLEASE HELP US TO KEEP THIS SITE RUNNING

 

 

Please note that my posts are my opinion only and should not be taken as any kind of legal advice.

 

If I've helped you at all, please feel free to click on the little star under my posts and leave feedback :)

Share this post


Link to post
Share on other sites
Looks like a job for an Excel macro/script. Shouldn't be too difficult to set one up to import the data in to a work sheet.

Probably - but it's beyond me.

Also, I don't think a macro which is based upon recording keystrokes would work

 

Note: I'm not an expert with Windows or Excel... But excel macros can also include VBA scripts which in turn can call on regular expressions (abbreviated to Regex). A regex is a very powerful way of matching strings and can be used to extract the data you want. If you didn't want to resort to VBA macros, there is the option of using Perl to interrogate the log and spit out a CVS file that can be imported in to your spreadsheet.


PLEASE HELP US TO KEEP THIS SITE RUNNING

EVERY POUND DONATED WILL HELP US TO KEEP HELPING OTHERS

 

 

Quote
No... you can't eat my brain just yet. I need it a little while longer.

Share this post


Link to post
Share on other sites
Note: I'm not an expert with Windows or Excel... But excel macros can also include VBA scripts which in turn can call on regular expressions (abbreviated to Regex). A regex is a very powerful way of matching strings and can be used to extract the data you want. If you didn't want to resort to VBA macros, there is the option of using Perl to interrogate the log and spit out a CVS file that can be imported in to your spreadsheet.

 

I feel like I've just landed on the set of The Big Bang Theory :lol:


We could use your help

PLEASE HELP US TO KEEP THIS SITE RUNNING

 

 

Please note that my posts are my opinion only and should not be taken as any kind of legal advice.

 

If I've helped you at all, please feel free to click on the little star under my posts and leave feedback :)

Share this post


Link to post
Share on other sites
You use the program to open the log file, then use Ctrl F to find the fields you require, the Shift & arrow keys to highlight the area that you want, and then Ctrl C to copy it.

 

Set up an input field on your excel spreadsheet and use Ctrl V to paste the data that was copied from the log file.

 

 

Don't get me wrong, it will take some tweaking (and it's a bit long winded) to get it to do exactly what you want, but it can be done, and once it's set up it's a single keystroke or mouse click to execute it.

 

Download & install it, and I'll email you a file with a sample macro so that you can see what I mean from your example above.

 

thank you but this is basically a keystroke logger/recorder. It's lumpy but it's fine so long as the data which it is harvesting occupies exactly the same space each time. As soon as the data string is a character longer or is a character shorter than the whole thing falls to pieces.

 

I need something which is a bit smarter which will search for the data field name and then harvest whatever comes after it until the space.


Share this post


Link to post
Share on other sites
Note: I'm not an expert with Windows or Excel... But excel macros can also include VBA scripts which in turn can call on regular expressions (abbreviated to Regex). A regex is a very powerful way of matching strings and can be used to extract the data you want. If you didn't want to resort to VBA macros, there is the option of using Perl to interrogate the log and spit out a CVS file that can be imported in to your spreadsheet.

 

I have no idea what you're talking about but I suppose you're probably right. However I need somebody to write it for me – and that's what I'm asking here.


Share this post


Link to post
Share on other sites
It's lumpy but it's fine so long as the data which it is harvesting occupies exactly the same space each time. As soon as the data string is a character longer or is a character shorter than the whole thing falls to pieces.

 

Ahh, didn't realise that the length of the data in the same field would change. In that case, you're right, it'd be no use at all.


We could use your help

PLEASE HELP US TO KEEP THIS SITE RUNNING

 

 

Please note that my posts are my opinion only and should not be taken as any kind of legal advice.

 

If I've helped you at all, please feel free to click on the little star under my posts and leave feedback :)

Share this post


Link to post
Share on other sites

Hey Marc

 

I might be wrong but would it be possible to use a bat file and the find command?

 

If you got it to dump to a text file with each field separated by commas it should be easyish to import

 

Sorry I can't help more excel isn't my field


Please note:

 

  • I am employed in the IT sector of a high street retail chain but am not posting in any official capacity,so therefore any comments,suggestions or opinions are expressly personal ones and should not be viewed as an endorsement or with agreement of any company.
  • i am not legal trained in any form.
  • I have many experiences in life and do often use these in my posts

if ive been helpful kick my scales, if ive been unhelpful kick the scales of the person more helpful :eek:

Share this post


Link to post
Share on other sites

Thanks. I'm afraid I think that it is rather more complicated than that and having looked around the forum I think it is probably something a bit like

 

https://social.technet.microsoft.com/Forums/en-US/105ceecf-7c7a-468d-bcd2-ee4a1231567b/extract-data-from-a-log-txt-and-import-them-in-excel?forum=winserverpowershell

 

But I have no idea what it all means or how to implement it

 

In fact even in that link above, the data that the guy wants to extract is very uniform. The data I want to extract is far more variable and so poses greater problems


Share this post


Link to post
Share on other sites

  • Recently Browsing   0 Caggers

    No registered users viewing this page.


  • Have we helped you ...?


×
×
  • Create New...