• Login
Community
  • Login

[New Plugin] CSV Lint

Scheduled Pinned Locked Moved Notepad++ & Plugin Development
83 Posts 26 Posters 98.2k 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.
  • B
    Bas de Reuver @Bas de Reuver
    last edited by Nov 9, 2022, 11:41 AM

    With the Notepad++ update to v8.4.7 yesterday, the new Plugin Admin now also contains an update for CSVLint plug-in from v0.4.5.4 to v0.4.6.2. I hope the plugin will save everyone some time when working with csv files, let me know what you think.

    It now also has a sort function and improved compatibility with Windows 11 unicode UTF8 setting. Also the default syntax highlighting now has 12 colors instead of 8, with a bit more pleasing colors imho.

    csvlint_sort.png

    See below for complete list of plugin updates and bugfixes since the last Notepad++ version:

    v0.4.6

    • Improved compatibility with Windows unicode UTF8 setting
    • Sort data, new option to sort on column
    • Split column, add options pad character and search and replace
    • Split column, remove options when contains and decode multiple value
    • Default color sets now have 12 colors instead of 8 (less repeats) + optimal color contrast
    • Settings dialog, color set preview icons
    • Autodetect improved, skip empty lines + clear message when nothing detected
    • Metadata for fixed width, also output absolute positions

    v0.4.6.1

    • Apply quotes bugfix, also values that contain CrLf character
    • Sort data and split column, use quotes correctly
    • Sort data and split column, also support fixed width

    v0.4.6.2

    • Detect fixed width, allow manual column positions
    • Button to toggle syntax highlighting
    • Allow user to change font in docked window textboxes
    D 1 Reply Last reply Nov 12, 2022, 7:04 PM Reply Quote 7
    • D
      datatraveller1 @Bas de Reuver
      last edited by Nov 12, 2022, 7:04 PM

      HI @Bas-de-Reuver,
      Thank you for the plugin. The plugin is nice, but sometimes I want to switch to the original Notepad++ view for a .csv file. Is there an option to turn off the CSV Lint view?

      D 1 Reply Last reply Nov 14, 2022, 1:59 PM Reply Quote 1
      • D
        datatraveller1 @datatraveller1
        last edited by Nov 14, 2022, 1:59 PM

        I have found out that switching the menu point “Language” - “CSVLint” to Language - “None (Normal Text)” is most probably the solution.

        B 1 Reply Last reply Nov 21, 2022, 4:26 PM Reply Quote 0
        • B
          Bas de Reuver @datatraveller1
          last edited by Nov 21, 2022, 4:26 PM

          @datatraveller1 Yes you’re right , it’s the menu Language > None (Normal Text) to clear the syntax highlighting colors from a csv file.

          Btw in the latest version of the plug-in v0.4.6.2 there is also a button on the docked windows to toggle between CSV Lint colors or no syntax highlighting. It does the same thing as the Language menu items though.

          1 Reply Last reply Reply Quote 1
          • F
            Fruchtzwerg94
            last edited by Nov 22, 2022, 8:55 PM

            The latest version includes a PR which I’ve created exactly to target this issue:
            PR: Added button to enable or disable language #42
            GIF
            Should be exactly what you are looking for in a very simple way.

            1 Reply Last reply Reply Quote 4
            • L
              le dinhyen
              last edited by Dec 8, 2022, 11:22 AM

              Hello guys i’m newbie here :( i have a csv data as below. Is there any way to align it to column like excel did?

              "@ABC_INFORMATION"
              "ID1","ID2","ID3"
              "ip1","ip2",""
              
              1 Reply Last reply Reply Quote 0
              • D
                datatraveller1
                last edited by Dec 8, 2022, 7:53 PM

                @le-dinhyen There is another plugin (CSVQuery) that displays the columns aligned, but this plugin is not suitable for editing. I would recommend a CSV editor for editing CSV files. (I could tell you good CSV editors, but they are not freeware).

                BTW, your CSV file is not a valid CSV file. A CSV file must conform to RFC 4180 CSV rules (https://www.rfc-editor.org/rfc/rfc4180).
                Each line must have the same number of fields, but your first line contains one field and the other three fields.

                L 1 Reply Last reply Dec 9, 2022, 1:27 AM Reply Quote 4
                • L
                  le dinhyen @datatraveller1
                  last edited by Dec 9, 2022, 1:27 AM

                  @datatraveller1 Yes . my csv file format is specific for customer system. we used to open it by rainbow csv in visual studio. i’m just wondering if we have any function that can display the columns aligned and edit it in realtime. Thank you so much for reply

                  1 Reply Last reply Reply Quote 0
                  • B Bas de Reuver referenced this topic on Mar 22, 2023, 9:51 PM
                  • P
                    Pierre de la Verre
                    last edited by Mar 29, 2023, 8:10 AM

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

                    A CSV with 45 columns (650 characters long), semicolon : separator, 16 lines. The display in different colours is OK, but I want to “convert” it to a “space separated” file, like

                    Col1        Col2    Col3
                    1.2         4.5    John
                    

                    So I select “Reformat / Column Separator: Fixed Width”. The result is that is removed the defined header and creates a file with no space between the columns, like

                    1.24.5John
                    

                    What is the problem here, how to do it right?

                    Thanks

                    L P 2 Replies Last reply Mar 29, 2023, 8:55 PM Reply Quote 0
                    • L
                      Lycan Thrope @Pierre de la Verre
                      last edited by Lycan Thrope Mar 29, 2023, 9:05 PM Mar 29, 2023, 8:55 PM

                      @Pierre-de-la-Verre ,
                      I was just messing with it myself to see what you were talking about, and the problem is that you need to read the help documentation. The fixed width puts it to the size of the fields, which means, there is no padding between the actual data, and the field boundaries as one runs into the next based on each columns defined width. I suspect if you want more space, you’ll need to make the fields larger than you really need them, so they’ll have some padding between the data in each field, and the size should also be larger than the header column names as well so those don’t run into one another.

                      Here’s the help description for the Column Separator:

                      Column separator

                      Reformat the column separator, for example from comma separated , to semicolon separated ;. Any values that contain the new separator character will be put in quotes, for example "error; no read".

                      When converting to fixed width format, it will use the width of each column as set in the metadata. Integer or decimal values will be right aligned, any other datatypes are left aligned.
                      `

                      P 1 Reply Last reply Mar 30, 2023, 10:11 AM Reply Quote 3
                      • P
                        Pierre de la Verre @Lycan Thrope
                        last edited by Mar 30, 2023, 10:11 AM

                        @Lycan-Thrope

                        yes, beside the deleting of the header line, which is strange for me, it does what it describes. But as a suggestion for improvement I add screenshots from the CSV-Format-feature in UltraEdit, which seem more flexible (keeping of the separator!) and better to me.

                        UE before
                        ue_before.PNG

                        UE after
                        ue_after.PNG

                        NPP before
                        npp_before.PNG

                        NPP after
                        npp_after.PNG

                        A L 2 Replies Last reply Mar 30, 2023, 10:50 AM Reply Quote 0
                        • A
                          Alan Kilborn @Pierre de la Verre
                          last edited by Mar 30, 2023, 10:50 AM

                          Is this an Excel support site??

                          P 1 Reply Last reply Mar 30, 2023, 11:42 AM Reply Quote 1
                          • P
                            Pierre de la Verre @Alan Kilborn
                            last edited by Mar 30, 2023, 11:42 AM

                            @Alan-Kilborn said in [New Plugin] CSV Lint:

                            Is this an Excel support site??

                            ???

                            A 1 Reply Last reply Mar 30, 2023, 11:48 AM Reply Quote 0
                            • A
                              Alan Kilborn @Pierre de la Verre
                              last edited by Mar 30, 2023, 11:48 AM

                              @Pierre-de-la-Verre

                              I was mainly referring to where things seemed to be going with “Here’s the help description for the Column Separator”…

                              But OK, if this is helpful to CSV Lint plugin…

                              artyb55A 1 Reply Last reply Mar 30, 2023, 5:11 PM Reply Quote 1
                              • artyb55A
                                artyb55 @Alan Kilborn
                                last edited by Mar 30, 2023, 5:11 PM

                                Hi,
                                I don’t know if this the best place to ask for features for the plugin?

                                I need to work with CSV files that aren’t compliant with RFC 4180 CSV rules, and I can’t change their format. They have some rows of differing lengths, and some fields are encloses in quotes even though they don’t strictly have to be according to the standard. I’ve been searching for an editor that will allow me to move some fields, and delete some columns, WITHOUT changing the formatting of the CSV file. I don’t know that could be added as an extension?

                                Or do people have suggestions of other software to use? I’ve tried LOTS of editors and only found one commercial piece of software that does what I need.

                                BW,
                                A

                                PeterJonesP 1 Reply Last reply Mar 30, 2023, 5:52 PM Reply Quote 0
                                • PeterJonesP
                                  PeterJones @artyb55
                                  last edited by Mar 30, 2023, 5:52 PM

                                  @artyb55 said in [New Plugin] CSV Lint:

                                  Hi,
                                  I don’t know if this the best place to ask for features for the plugin?

                                  Best, no: the plugin has a github issues page where you can make feature requests. But the developer of that plugin does swing by here occasionally, and will likely eventually see your request.

                                  I need to work with CSV files that aren’t compliant with RFC 4180 CSV rules, and I can’t change their format. They have some rows of differing lengths, and some fields are encloses in quotes even though they don’t strictly have to be according to the standard.

                                  Neither of those are a problem for the CSV Lint plugin. Well, extra quotes is not a problem at all. The too-few-fields has a workaround in CSV Lint.

                                  If you load a CSV with CSV Lint active, and it highlights it all blue (pretends it’s one column), then do Plugins > CSV Lint > CSV Lint Window, make sure the checkbox for “automatic” is unchecked, and click Detect Columns to manually detect the columns: at that point, it will pop up a dialog:
                                  75763957-663a-4ad0-baed-613041ef0929-image.png
                                  Tell it you want comma as the separator, and check or uncheck the “header names” option. Then it will highlight based on number of fields per line, even if there aren’t a consistent number of fields.

                                  I’ve been searching for an editor that will allow me to move some fields, and delete some columns, WITHOUT changing the formatting of the CSV file. I don’t know that could be added as an extension?

                                  Well, CSV Lint is not a spreadsheet editor, and I don’t think it has column-moving or column-deleting options. My guess is that adding the change the order of columns would be a huge feature addition. As would “field” operations like “easily” moving from one field column to another for just one record.

                                  Or do people have suggestions of other software to use? I’ve tried LOTS of editors and only found one commercial piece of software that does what I need.

                                  This forum is focused on Notepad++. Notepad++ is focused on editing the text of the file, not the “spreadsheet-like qualities” behind that text. And a Notepad++ text-editor forum seems a strange (off-topic) place to ask for recommendations for non-Notepad++, non-text-editor software recommendations.

                                  But in Notepad++, you might be able to use the “CsvQuery” plugin to use SQL commands to manipulate the data; you might be able to delete a column in SQL commands, or move field values around, and then have that plugin take the final state of the SQL table and put it back as the raw CSV… but I only do SQL for about 1 day per year, and couldn’t tell you how; and I don’t know that plugin well enough to know if it saves the final state of the table as CSV in the same format that it started as (nor what it would do, whether it would remember extra quotes or not).

                                  artyb55A 1 Reply Last reply Mar 31, 2023, 8:46 AM Reply Quote 3
                                  • L
                                    Lycan Thrope @Pierre de la Verre
                                    last edited by Mar 30, 2023, 8:33 PM

                                    @Pierre-de-la-Verre ,
                                    Well, now you’re changing a why is this doing this and how do I do it right to this should be improved to do what I want.
                                    If it’s not doing what you want, you should make a feature request to the author of the plugin, the website link of which is in the plugin’s About dialog.
                                    There you can make a request, and a donation, which might even get their attention beyond their just being interested in implementing that kind of feature for their own use.

                                    1 Reply Last reply Reply Quote 1
                                    • Thomas McArthurT
                                      Thomas McArthur
                                      last edited by Mar 31, 2023, 2:26 AM

                                      CSV Lint crashes NP++ using 32bit v8.5 and a 750 line CSV file. I didn’t notice the version of CSV Lint before I uninstalled it, but the plugin updater said there were no updates to install.

                                      Terry RT 1 Reply Last reply Mar 31, 2023, 2:45 AM Reply Quote 0
                                      • Terry RT
                                        Terry R @Thomas McArthur
                                        last edited by Mar 31, 2023, 2:45 AM

                                        @Thomas-McArthur

                                        Do you have any other plugins? Sometimes these faults occur because of some side effect from a plugin without seemingly using that particular plugin.

                                        You’d need to recheck and provide the debug info from your installation before anyone can take serious notice.

                                        There is a FAQ post called Notepad++ Crashes/Freezes/Unresponsive after Update which explains what’s necessary to better identify the culprit.

                                        Terry

                                        Thomas McArthurT 1 Reply Last reply Mar 31, 2023, 3:19 AM Reply Quote 0
                                        • Thomas McArthurT
                                          Thomas McArthur @Terry R
                                          last edited by Mar 31, 2023, 3:19 AM

                                          @Terry-R Done. It still crashes. Here are my specifics:

                                          1. I uninstalled all other plugins
                                          2. I reinstalled CSV Lint
                                          3. I use dark mode in NP++
                                          4. Select CSVLint in the Language menu
                                          5. Both dark modes in CSV Lint (Neon and Pastel) crash NP++
                                          6. I have multiple files/tabs open in NP++.
                                          7. Tabs are configured for multi-line, no X/close button on tabs, d-c to close
                                          8. The crash happens with these steps:
                                            8a) Launch NP++
                                            8b) a CSV is active when NP++ launches
                                            8c) Select a non-CSV tab
                                            8d) Reselect the CSV tab that was open when NP++ launched
                                            8e) NP++ crashes with no errors or popups
                                          9. If I leave None (Normal text) selected in the Language menu, NP++ does not crash, no matter how many times I select the CSV tab

                                          NP++ Debug info:

                                          Notepad++ v8.5 (32-bit)
                                          Build time : Mar 6 2023 - 02:15:26
                                          Path : C:\Program Files (x86)\Notepad++\notepad++.exe
                                          Command Line :
                                          Admin mode : OFF
                                          Local Conf mode : OFF
                                          Cloud Config : OFF
                                          OS Name : Windows 10 Enterprise (64-bit)
                                          OS Version : 22H2
                                          OS Build : 19045.2604
                                          Current ANSI codepage : 1252
                                          Plugins :
                                          CSVLint (0.4.6.2)

                                          Thomas McArthurT L 2 Replies Last reply Apr 3, 2023, 12:40 PM Reply Quote 0
                                          • First post
                                            Last post
                                          The Community of users of the Notepad++ text editor.
                                          Powered by NodeBB | Contributors