Solved

Last Script not working

Posted on 2014-07-24
4
127 Views
Last Modified: 2014-07-24
Hi,

 The previous script given to us in the below thread didn't work for the attached file.
http://www.experts-exchange.com/Programming/Languages/Scripting/Shell/Batch/Q_28460484.html#a40185645

Can someone please help?
Report-02.txt
0
Comment
Question by:pvsbandi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 35

Expert Comment

by:Robert Schutt
ID: 40217942
The file you have attached here does not contain CR/LF line endings, only LF (0x0A). Probably a different source, a unix system instead of a windows system.

You can change the pattern on line 10 to accommodate for any combination of CR/LF, for example:
oRE.Pattern = "(1SIDFA1PD(?:\s|\S)*?JURISDICTION NUMBER: (\d{2})(?:\s|\S)*?NUMBER OF ACTION LOGS CREATED:.*[\r\n]{1,2})"

Open in new window

0
 

Author Comment

by:pvsbandi
ID: 40217982
Hi Robert,

  Great solution! Two questions though..
1. How could you figure out the endings are different?
2. What exactly is the meaning of the change you made?

Thanks again!
0
 
LVL 35

Accepted Solution

by:
Robert Schutt earned 500 total points
ID: 40218003
I tried parts of the pattern and all parts were working right up until the very last bit: "\r\n"...

Then I looked at the example file with a hex editor and saw only line feed (character code 10, represented by the \n) at the end of the lines instead of 'normal' windows files that have carriage return as well (character code 13, represented by \r).

The "\r\n" in the original pattern means these 2 characters need to be there to make the match true. In the new version 1 of the characters is enough but they can both be present (I haven't tested that by the way!)

This means files from windows, unix or mac should all be accepted now by the script (and others actually like \n\r or \r\r but you will probably never encounter those).
0
 

Author Closing Comment

by:pvsbandi
ID: 40218144
Thanks a lot!!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This is pretty cool.  The purpose of this VB Script is to help you document where JAR (Java ARchive) files and specifically java class files are located so that you can address issues seen with a client or that you can speak intelligently with a dev…
This article is the result of a quest to better understand Task Scheduler 2.0 and all the newer objects available in vbscript in this version over  the limited options we had scripting in Task Scheduler 1.0.  As I started my journey of knowledge I f…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…
Suggested Courses

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question