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

Get help with installation and running here.

Moderators: DataMystic Support, Moderators

Post Reply
rukiddin50
Posts: 2
Joined: Mon Aug 14, 2017 10:51 am

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

Post by rukiddin50 » Mon Aug 14, 2017 11:05 am

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

User avatar
DataMystic Support
Site Admin
Posts: 2211
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

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

Post by DataMystic Support » Tue Aug 15, 2017 7:35 pm

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
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

rukiddin50
Posts: 2
Joined: Mon Aug 14, 2017 10:51 am

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

Post by rukiddin50 » Wed Aug 16, 2017 12:44 am

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.

User avatar
DataMystic Support
Site Admin
Posts: 2211
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

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

Post by DataMystic Support » Wed Aug 16, 2017 6:23 am

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).
Regards,

Simon Carter, http://DataMystic.com/forums/index.php
http://PredictBGL.com - Insulin dose calculator for Type 1 diabetes
http://DownloadPipe.com - 250,000 free software downloads
http://DetachPipe.com - send huge email attachments

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests