ANSI X12/EDIFACT document viewing
-
I’ve seen occasional and “generic” requests for some built-in support for documents using either or both of these formats for Electronic Data Interchange (EDI), as well as some proposed progress towards implementing such support (e.g., issue #6173 on GitHub).
I realize that, for many, this is likely a low-priority issue, but for many of us who use NP++ and deal with EDI transactions on a regular basis, adding more full-featured support for these documents would be tremendously beneficial. I’ve also used and “tweaked” the XML style information provided in an answer on StackOverflow to the question about X12 syntax highlighting for Notepad++? for my own purposes, and it works well enough when trying to get a quick look at an X12 document. I’ve even created a registry file for Windows I can import which creates explicit associations for EDI files with NP++ (and assigns a recognizable “X12” icon to these files to help pick them out in a directory view). But, these simple “tricks” certainly have their limitations and would be enhanced by better support for the format within NP++.
A few of the features that would be desired in an EDI implementation for ANSI X12 documents (I don’t currently work with EDIFACT documents, so I’ll just focus on the ANSI X12 structure) would include:
- Folding of segments and segment groups such as Hierarchical Levels (HL’s)
- Keyword identification of segment types - specifically in the first position
- Identification of segment terminators as well as element/value separators
- Keyword identification of element types - specifically within a segment and enclosed by the element separator
Amongst others that I’m sure I’m not considering at the moment.
I post this here to try to provide some more specific details about what I’m looking for. I know that I could use one of the other text editors out there, and even some of the “paid” utilities that are explicitly designed to handle ANSI X12/EDIFACT documents, but I would much prefer to simply improve on the functionality of a tool with which I’m already familiar. Please feel free to ask questions or include your own suggestions for things I’ve overlooked. Thank you.
-
Hello, I don’t know if can be useful for you, but I started to develop a plugin for Notepad++ that help in the analysis of the content of EDI files.
At this moment is in early stage of development and it support only the EDIFACT format but soon I’ll develop also the part for the X12 format (stay tuned!)You can download the lates release version here: https://github.com/innox80/NppEdiAnalyzer/
-
@innox80 :
First of all, thank you & hello from France. I deal with EDI files since 20 years and that remains a useful tool therefore bravo for your initiative.I installed your beta NPP EDI Analyzer plugin, and here is my feedback :
-
format/unformat works fine for EDI FACT messages (even if I could do the same with some macro in NPP++) but didn’t test with ANSI X12 files
-
structure view works until double-click on an EDI data element ; from there, I have the following feature comment : this shows the element/component name but for EDI professionals, the best would be to have data element/component values (e.g DE3039 for NAD or C829.1082 for LIN, etc…)
(actually, I notice the “Ref.Table Values” in the combo box below" but not sure what this refers to).
In any case, well done. Keep going with this useful plugin.
Thanks, -
-
Hello @Jean-Luc thanks for your interest in NppEdiAnalizer and thanks so much for your suggestions.
About your points:- the format/unformat is developed now only for the EDIFACT, I think to extend (in general all the features) to the X12 in the next release
- I take note of your suggestion about the element/component values (e.g DE3039 for NAD or C829.1082 for LIN, etc…) for the next improvements, I’ll work on that
- The meaning of the “Ref.Table Values” combobox is to show the available codified values/description for the selected field in the list on the right (here non many data is loaded for now, I have to add more values to have the full coverage)
I’ll try to do a new release by the end of this month of February , so stay tuned!
-
@innox80 Any news on the new release, and would it include X12 support as well?
-
hello! i found this thread during a Google search for EDI support for notepad++. it looks like your Github project hasn’t been updated in a few years. did you ever get X12 working? would love to try it
-
Unfortunately, @innox80 hasn’t been back since February 2021, so it’s doubtful you’ll get a direct response.
However, you are in luck: according to the N++ Issue#6173 that was linked above, the EDIFACT and X12 lexers are in the lexer library (Lexilla) that Notepad++ uses for syntax highlighting. Which means, they are what I call “hidden lexers”, and I’ve previously made a script for the PythonScript plugin which can enable hidden lexers.
You can download the most recent version of the script from my repo for pythonscripts from this link:
HiddenLexers.py
.The script doesn’t yet enable the X12 lexer, but as I have time over the next day or two, I’ll work on it; I’ll post an update (either updating this post, or replying) once I have it available.
If you could tell me the common filename extensions for X12 and/or EDIFACT, I can include those as I’m customizing the script.
Once the script is updated, you can follow the instructions in our How to install and run a script in PythonScript, which will explain how to install the plugin and install and run the script. If you want the
HiddenLexers.py
script to automatically run whenever you launch Notepad++, make sure you follow the STARTUP instructions at the end of the INSTALLATION section of the FAQ, and you would need toimport HiddenLexers
in yourstartup.py
script, as described in that section of the FAQ. -
I assumed the X12 EDI extension is
.x12
. TheHiddenLexers.py
download has been updated to enable the X12 lexer for all files ending in.x12
.Since I know nothing about X12, I just found the example file used here (so I used the same
.x12
file that Lexilla uses when testing their LexX12.cxx for the library that Notepad++ uses).I even was able to enable the folding (which is something I hadn’t tried in HiddenLexers to date).
You can now follow the FAQ instructions for installing the plugin and running the script.
If you don’t like the colors I chose (understandable), you can go to the line starting at
editor.styleSetFore(self.SCE_X12_DEFAULT
, and change the RGB triples for the foreground and/or the background. (If you change the colors: if you use the STARTUP version, you can exit notepad++ and rerun to get it to use the new colors; if you manually ran the script instead, you can just run the script twice more – the first will clear the old settings and the second will re-enable HiddenLexers using the new colors) -
@PeterJones said in ANSI X12/EDIFACT document viewing:
eb5aac25-b4bb-4727-9e59-b9074c043624-image.png
I got a 404 not found error when I tried to see the colors you picked. The link goes to https://community.notepad-plus-plus.org/assets/uploads/files/1732217676249-eb5aac25-b4bb-4727-9e59-b9074c043624-image.png which seems ok.
-
@mkupper ,
The image has inexplicably disappeared off the server: I don’t know why. (And if you refresh your browser on the full URL, I think it will be 404 as well) I might have to try to regenerate it…