Solved

Last Script not working

Posted on 2014-07-24
4
121 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
  • 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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

This is an addendum to the following article: Acitve Directory based Outlook Signature (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_24950055.html) The script is fine, and works in normal client-server domains…
Welcome back!  My apologies for taking so long to write part two of this series; it's been a long time coming!  As I promised in Part 1, this article will focus on how to locate those elusive AD properties that you are searching for.  Why is this us…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.

786 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