Community
    • Login

    [New Plugin] CSV Lint

    Scheduled Pinned Locked Moved Notepad++ & Plugin Development
    81 Posts 25 Posters 72.0k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Pierre de la VerreP
      Pierre de la Verre @Pierre de la Verre
      last edited by Pierre de la Verre

      @Pierre-de-la-Verre said in [New Plugin] CSV Lint:

      Hi
      I just started with this plugin and have a problem …
      …

      Solved here: https://github.com/BdR76/CSVLint/issues/58#issuecomment-1496656520

      Short story: Use “Reformat” only with “Align vertically / Re-apply vertically: none” - that’s all

      1 Reply Last reply Reply Quote 2
      • Thomas McArthurT
        Thomas McArthur @Lycan Thrope
        last edited by

        @Lycan-Thrope I use the 32bit version because the plugin support for the 64bit version was extremely limited. Plugins that I used daily weren’t available in 64bit, so I stayed with 32bit. Memory is not an issue - I am using less than half of the 32GB that is installed. I will try the 64bit again to check out the plugin support.

        Michael VincentM Alan KilbornA 2 Replies Last reply Reply Quote 1
        • Michael VincentM
          Michael Vincent @Thomas McArthur
          last edited by

          @Thomas-McArthur said in [New Plugin] CSV Lint:

          Plugins that I used daily weren’t available in 64bit

          It’s getting better - are there still some 32-bit only plugins that you can’t part with?

          Cheers.

          1 Reply Last reply Reply Quote 1
          • Alan KilbornA
            Alan Kilborn @Thomas McArthur
            last edited by

            @Thomas-McArthur said in [New Plugin] CSV Lint:

            Memory is not an issue - I am using less than half of the 32GB that is installed.

            I’m curious what this means.

            1 Reply Last reply Reply Quote 1
            • Bas de ReuverB
              Bas de Reuver
              last edited by Bas de Reuver

              @Thomas-McArthur and @Lycan-Thrope about the issue of CSV Lint and Notepad++ sometimes crashing when switching between different CSV tabs.

              I think this is the same as issue #32, and recently I was able to reproduce a similar situation. That situation was due to potentially using an out-of-sync reference to the ScintillaGateWay and I’ve fixed it in this commit

              Can you verify that it doesn’t crash anymore by using the latest development build? The syntax highlighting colors sometimes still don’t refresh immediately, only when you focus the file (click mouse somewhere in csv text), but at least it shouldn’t crash Notepad++ anywmore.

              Mark OlsonM Thomas McArthurT 3 Replies Last reply Reply Quote 2
              • Mark OlsonM
                Mark Olson @Bas de Reuver
                last edited by

                @Bas-de-Reuver
                I used to have problems with multi-instance/multi-view in JsonTools (I use an editor singleton global variable to interface with Scintilla), and what worked for me was to make it so that whenever the plugin receives an NPPN_BUFFERACTIVATED notification, the global editor is reassigned with editor = new ScintillaGateway(PluginBase.GetCurrentScintilla());.

                In principle this approach should never fail, because that notification will always fire whenever the user toggles between instances/views. If one of the gurus can think of a reason why I’m wrong, I’d love to hear it.

                Granted, you’d have to refactor all your existing code to remove all those calls, but it might simplify matters for you.

                1 Reply Last reply Reply Quote 4
                • Bas de ReuverB Bas de Reuver referenced this topic on
                • Bas de ReuverB Bas de Reuver referenced this topic on
                • Thomas McArthurT
                  Thomas McArthur @Bas de Reuver
                  last edited by

                  @Bas-de-Reuver I tried the 64bit development build, but I get an error that it’s not compatible with v8.5.2. Are there dev builds of NP++? I don’t see any in the downloads page.

                  However, using your dev build may not be unnecessary because I can reproduce the problem in the non-dev 64bit version. The crash only happens when I have a CSV file that is too wide to fit on the page, so I turn off word wrap. With word wrap enabled, I can switch between CSV and non-CSV tabs fine. But when I enable word wrap in my 380-character wide CSV file, NP++ crashes when switching to that tab (and colorization is enabled).

                  Mark OlsonM 1 Reply Last reply Reply Quote 1
                  • Mark OlsonM
                    Mark Olson @Thomas McArthur
                    last edited by Mark Olson

                    @Thomas-McArthur
                    The only way I know of to get a dev build of Notepad++ is to build it from source using Visual Studio.

                    I’ve tried CSVLint on my own 8.5.2 dev build and I can toggle word wrap on and off even with 400+ character columns on a 20MB file with no problems.

                    In my experience, it’s pretty rare for a clean build of Notepad++ to outright crash, so consider checking if any of your other plugins could be causing this.

                    1 Reply Last reply Reply Quote 2
                    • Thomas McArthurT
                      Thomas McArthur @Bas de Reuver
                      last edited by

                      @Bas-de-Reuver v0.4.6.3 still crashes NP++.

                      I also tried downgrading NP++ to v8.4.5 and v8.5, and CSV Lint v0.4.6.3 still crashes those versions.

                      Bas de ReuverB 1 Reply Last reply Reply Quote 0
                      • Bas de ReuverB
                        Bas de Reuver @Thomas McArthur
                        last edited by Bas de Reuver

                        @Thomas-McArthur That does sound like an serious issue, however I can’t reproduce what you’re describing.

                        I generated a test file with many columns (using generate_data99.py script) and then turning Word wrap on and off while switching between csv/non-csv tabs.

                        Maybe it has to do with the file encoding, does it also still happen when you first convert the file to a different encoding like ANSI or UTF8 and then save, and then try again? Or possibly it has to do with the session.xml file, does it still happen when you delete/rename your recent %userprofile%\AppData\Roaming\Notepad++\session.xml file and then re-open Notepad++? If it still happens, could you send me an e-mail with your ? > Debug info content?

                        1 Reply Last reply Reply Quote 0
                        • Bas de ReuverB
                          Bas de Reuver
                          last edited by

                          The CSV Lint plug-in was updated to v0.4.6.4 yesterday. The biggest new features are:

                          • Syntax highlighting improvement for Windows set to non-western codepage (Chinese, Korean etc.)
                          • Skip Lines / Comment Character for comment lines
                          • Dialogs have Dark mode support (preliminary)
                          • Improved support for quoted string
                          • Allow user to delete column
                          • Split on character, new option split on Nth occurrence
                          • Various bug fixes

                          The skiplines and comment lines feature:
                          CSV Lint skiplines and comment lines feature

                          And improved support for syntax highlighting when set to non-western codepage
                          CSV Lint non-wester codepage

                          I made the release, despite some reporting the new version crashing, because I wasn’t able to reproduce the issue (also see here and here).

                          If anyone can reproduce the plugin crashing on the latest Notepad++ version, or a possible cause, please let me know.

                          Thomas McArthurT antoineDionA 3 Replies Last reply Reply Quote 6
                          • Thomas McArthurT
                            Thomas McArthur @Bas de Reuver
                            last edited by

                            @Bas-de-Reuver NP++ v8.5.2 64bit with CSV Lint v0.4.6.3 installed does not show any plugin updates.

                            PeterJonesP Bas de ReuverB 2 Replies Last reply Reply Quote 0
                            • PeterJonesP
                              PeterJones @Thomas McArthur
                              last edited by PeterJones

                              @Thomas-McArthur said in [New Plugin] CSV Lint:

                              NP++ v8.5.2 64bit with CSV Lint v0.4.6.3 installed does not show any plugin updates.

                              Of course it doesn’t. Notepad++'s plugin list is only updated on a new release of Notepad++, and Notepad++ v8.5.2 came out on April 6, essentially a month before CSV Lint’s 0.4.6.4 update on May 2. If a plugin is released between Notepad++ versions and you want that updated plugin, you have to manually update the plugin.

                              1 Reply Last reply Reply Quote 1
                              • Thomas McArthurT
                                Thomas McArthur @Bas de Reuver
                                last edited by

                                @Bas-de-Reuver I found the cause of the crash: it’s the Multi-Line setting for the Tab Bar. When that is enabled, and the tabs wrap to 2+ lines, activating a CSV tab a 2nd time crashes NP++.

                                • Enable multi-line, and only have one line of tabs - no crash.
                                • Un-maximize the window, drag it small enough to create 2+ rows of tabs - activating a CSV tab a 2nd time crashes NP++.

                                This crash even happens on a fresh download of NP++ v8.5.2 portable.

                                rdipardoR 1 Reply Last reply Reply Quote 3
                                • rdipardoR
                                  rdipardo @Thomas McArthur
                                  last edited by

                                  @Thomas-McArthur, I can’t make it crash for me, but it could simply be I don’t understand your instructions.

                                  1. Does “Multi-Line” mean that long lines are wrapped, i.e. the option at View > Word wrap has a ✅ beside it?

                                  2. Exactly how many different files are open at the same time? Is there a CSV file, and one more file of a different type? Or is the same CSV file open in multiple views, i.e., did you go to View > Move/Clone Current Document and then click Move/Clone to Other View?

                                  Snabel42S 1 Reply Last reply Reply Quote 0
                                  • Snabel42S
                                    Snabel42 @rdipardo
                                    last edited by Snabel42

                                    @rdipardo I think this is checked: Settings / General / Tab Bar / Multi-line

                                    Then make sure the window is narrow enough where the Tab bar has more than one line.

                                    edit I can not replicate in version 0.4.6.4 64-bit

                                    1 Reply Last reply Reply Quote 0
                                    • Chr PqeC
                                      Chr Pqe
                                      last edited by Chr Pqe

                                      This plugin is a gamechanger. There are few bugs here and there nevertheless. For example,

                                      • it will not properly detect documents in the second NPP pane.
                                      • it seems to crash NPP a lot with CSV files using a lot of white or blank lines (maybe 50-100+ white/blank/tab lines at random positions)

                                      I understand that this not a CSV or spreadsheet editor or a data analysis plugin, but some obvious features are missing :

                                      • Change column position - add a simple menu item or button (in the CSV Lint window) to swap columns of the CSV
                                      • Sort by this column - this is an obvious feature that is missing, nevertheless for this one, if the first feature is implemented (change column position), I could simply swap the needed column to the first one then use NPP sort and it should do the same thing.

                                      I don’t think “changing column position” should be hard to integrate, since every column is already detected by a color (thus position).

                                      Also, the reason it is a bit troublesome to not have this feature, is that a lot of times CSV columns are not in the correct position to visualize and understand the data, which forces to open Excel or some spreadsheet just to modify the position of the column and go back to NPP.

                                      CoisesC Bas de ReuverB 2 Replies Last reply Reply Quote 0
                                      • Chr PqeC
                                        Chr Pqe @artyb55
                                        last edited by

                                        @artyb55 In your case for example, having a “change column position” would be useful aka you insert your column at the begening, then swap/change position of this newly edited column at the place you want

                                        1 Reply Last reply Reply Quote 0
                                        • CoisesC
                                          Coises @Chr Pqe
                                          last edited by

                                          @Chr-Pqe said in [New Plugin] CSV Lint:

                                          I understand that this not a CSV or spreadsheet editor or a data analysis plugin, but some obvious features are missing :

                                          • Change column position - add a simple menu item or button (in the CSV Lint window) to swap columns of the CSV
                                          • Sort by this column - this is an obvious feature that is missing, nevertheless for this one, if the first feature is implemented (change column position), I could simply swap the needed column to the first one then use NPP sort and it should do the same thing.

                                          It is possible that a plugin I’m currently developing, Columns++, would help you, though there are some significant caveats:

                                          1. It’s in alpha stage right now. I can’t promise it won’t crash Notepad++, so it’s important to keep work safe.
                                          2. You would need to use its conversion functions to convert separated values to tabbed display, then convert back if you need to save the document in its original form. Depending on the details of your file, some care with the conversion options may be necessary if you need it to “round trip” unchanged except where you’ve made edits.
                                          3. You would need to enable its Elastic tabstops feature to line up the columns; then you could use ordinary rectangular selections to move columns by cutting and pasting (admittedly, still a somewhat clumsy operation), and there are sort commands in the plugin that work with tabbed documents. Unfortunately, performance of Elastic tabstops is quite dependent on file size; e.g., I can edit a file with 1300 lines and 12 tabs per line and rarely notice any impact, but with 19,000 lines and 50 tabs per line, some operations can freeze for half a minute or more.

                                          There’s a thread over here about it, so this one doesn’t get cluttered, if you have questions, comments or reports.

                                          1 Reply Last reply Reply Quote 2
                                          • Bas de ReuverB
                                            Bas de Reuver @Chr Pqe
                                            last edited by Bas de Reuver

                                            @Chr-Pqe Thanks, nice to hear you like the plugin. 👍 Are there any functions of the plug-in that are especially helpful? I’d like to know because I can’t see which functions are most used or which aren’t used at all.

                                            A sort function was in fact already added a while ago in v0.4.6, also see comment of 9 november 2022 in this thread, which version of the plug-in do you have installed? When you open the CSV Lint docking window Plugins > CSV Lint > CSV Lint window there should be a Sort button. It even sorts date/float/integer columns correctly according to their values.

                                            And I agree, being able to change the column order would be a nice feature to have.

                                            1 Reply Last reply Reply Quote 1
                                            • Bas de ReuverB Bas de Reuver referenced this topic on
                                            • First post
                                              Last post
                                            The Community of users of the Notepad++ text editor.
                                            Powered by NodeBB | Contributors