shriprem / FWDataViz

Fixed Width Data Visualizer plugin for Notepad++. Turns Notepad++ into Excel for fixed-width data files. Displays cursor position data. Jumps to specific fields. Folding Record Blocks. Extracts Data. Builtin dialogs to configure file-type, record-type & fields; Themes & Colors; and Folding. Handles homogenous, mixed & multi-line records.
GNU General Public License v2.0
37 stars 6 forks source link

Improve "Record Starts With" #2

Closed jeff-bowles closed 3 years ago

jeff-bowles commented 3 years ago

Hi - I'll start by saying this is a fantastic, wonderful plugin! I work with lots of flat file data exchange formats and this will be a great time saver.

Possibly this feature already exists and I just have not found it yet.

My request:

One of the formats I work with has record identifiers not in the first text column, but in the fourth through seventh character positions. It would seem that the "Record Regex Key" alone should be enough to identify the record type, and the "Record Starts With" does not understand regex.

Is there an existing way to identify records that don't "start with" but "contain at position"? If not, would you consider adding this feature?

Thank you,

Jeff

shriprem commented 3 years ago

@jeff-bowles, please see the GSN-Flagged Weather Stations sample file provided with the plugin. You can find it under Sample Files » Sample Multiple-Record-Type Files. This sample has two record types:

  1. GSN Weather Station. Record Regex Key: ^.{72}GSN
  2. Non-GSN Weather Station. Record Regex Key: ^.{72}[^G]

You will note that for both these record types, the Record Starts With field is blank in the metadata editor and the .ini file. The Record Starts With is a convenience field for users. As this field is being input, it is immediately translated into the Record Regex Key field value. This Regex Key value is the one actually used by the plugin to visualize files.

The plugin's metadata editor does a reverse translation of the Record Regex Key field changes to the Record Starts With value only when possible. If the regex key is not based on the initial characters alone, it leaves the Record Starts With field blank.

If your record-type is going to be based solely on the regex key, you can leave the Record Starts With field blank.

Hope this clarifies your issue.

shriprem commented 3 years ago

Also, see ICD-10 Billable-Flagged Order Codes sample file. In this file, an order is deemed billable or not by the presence of '1' (billable) or '0' (non-billable) in the 15th position of each order record. The regex keys used here are ^.{14}1 and ^.{14}0, respectively.

@jeff-bowles , unless I hear otherwise in the next 24 hours, I will deem this issue needs no further resolution, and will close it.

jeff-bowles commented 3 years ago

Thank you so much, Shridhar. This is working as I wish. I think my first attempt I simply had bad regex expressions.

------ Original Message ------ From: "Shridhar Kumar" notifications@github.com To: "shriprem/FWDataViz" FWDataViz@noreply.github.com Cc: "jeff-bowles" eightbitwonder@gmail.com; "Mention" mention@noreply.github.com Sent: 3/1/2021 2:05:14 PM Subject: Re: [shriprem/FWDataViz] Improve "Record Starts With" (#2)

@jeff-bowles https://github.com/jeff-bowles, please see the GSN-Flagged Weather Stations sample file provided with the plugin. You can find it under Sample Files » Sample Multiple-Record-Type Files. This sample has two record types:

GSN Weather Station. Record Regex Key: ^.{72}GSN Non-GSN Weather Station. Record Regex Key: ^.{72}[^G] You will note that for both these record types, the Record Starts With field is blank in the metadata editor and the .ini file. The Record Starts With is a convenience field for users. As this field is being input, it is immediately translated into the Record Regex Key field value. This Regex Key value is the one actually used by the plugin to visualize files.

The plugin's metadata editor does a reverse translation of the Record Regex Key field changes to the Record Starts With value only when possible. If the regex key is not based on the initial characters alone, it leaves the Record Starts With field blank.

If your record-type is going to be based solely on the regex key, you can leave the Record Starts With field blank.

Hope this clarifies your issue.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/shriprem/FWDataViz/issues/2#issuecomment-788193605, or unsubscribe https://github.com/notifications/unsubscribe-auth/AHX3T75VFAJ4SABGTO2WU2LTBPQOVANCNFSM4YNBEF7A.

shriprem commented 3 years ago

Jeff, thank you for your kind compliments. Glad to have helped.