Page 1 of 1

Wrote a script years ago.. and it finally broke.. help?

Posted: Mon Aug 14, 2017 11:05 am
by rukiddin50
I wrote a script years ago to process a report generated by an old system. Recently the system changed their part number sequence and it seems to have broken the report.

Unfortunately, I barely learned how to use Textpipe, I got it to work for what I needed and never looked at it again. I also got some help at the time from these forums, so my understanding was never really complete.

Anyhow, my "Remove non-matching lines" string is

^ \w{2}\d{3}\w{1}|^ TTL|OPEN RMA

and my easy pattern is

[capture(0+ not cr or lf),cr,lf,capture(0+ not cr or lf),cr,lf,capture(0+ not cr or lf),cr,lf,]

The report starts each new item with a part number, in the past the part number would have been in the format of 9Z7927 or 963548 or RM8978 (note that the part number always ended in at least 4 numbers). Well recently they started throwing letters into the 3rd position, so the part number might look like C9Z434 or 99Z343. Anyhow, it's this third digit that is causing the script to no longer work. If I manually change the part number before running the process it works. Also, once it fails, it fails on all subsequent lines of the report.

I can post more detailed examples of the original files and what the output would look like, but thought someone might be able to quickly and simply answer the question from this description.

Any help would be appreciated..

Thank you

Mike

Re: Wrote a script years ago.. and it finally broke.. help?

Posted: Tue Aug 15, 2017 7:35 pm
by DataMystic Support
Try:

Code: Select all

^ \w{3}\d{2}\w{1}|^ TTL|OPEN RMA
This allows the first 3 characters to be letters or numbers, then insists on 2 digits, then allows one more letter or number

Re: Wrote a script years ago.. and it finally broke.. help?

Posted: Wed Aug 16, 2017 12:44 am
by rukiddin50
That was the first thing I tried, as it seemed that it would work, but for whatever reason the script reads and processes a bit, and then the output gets all whacked out.

Re: Wrote a script years ago.. and it finally broke.. help?

Posted: Wed Aug 16, 2017 6:23 am
by DataMystic Support
Sounds like it will require deeper investigation. We're happy to help, please see http://www.datamystic.com/buy/premium_support
(or you could try Upwork.com).

Re: Wrote a script years ago.. and it finally broke.. help?

Posted: Thu Sep 14, 2017 11:01 pm
by Arydigital
This allows the first 3 characters to be letters or numbers, then insists on 2 digits,

Code: Select all

http://www.arydigital.tv/ary-digital-old-dramas/
then allows one more letter or number

Code: Select all

https://www.arydigital.tv/videos/category/noor-ul-ain/