We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4749
    • 623 Posts
    I’d like to know if it’s possible to create a table of information from an imported CSV file. I would like to create a customer list (First, Last, Age, Email, Address, Phone, etc.) and display that list sorted by Age. Does anyone know of a solution for this? Or does anyone have an idea of how it could be done? Thanks.
      The MODx has you...
      Utah Web Design
      • 4749
      • 623 Posts
      Thanks for the response ganeshXL. I finally found this topic: http://modxcms.com/forums/index.php/topic,1666.msg11635.html#msg11635 it seems to be very similar to what I want. But, it won’t be a one-time upload. As more customers are added we’ll need to upload a new csv to overwrite the old one. However, the ideal solution would be to create a module where I can do this in the GUI and make it part of ModX. Maybe that’s what I’ll have to do. I was hoping someone had done it before or had a simple, working solution. So, feel free to suggest anything you think may work.
        The MODx has you...
        Utah Web Design
        • 6726
        • 7,075 Posts
        Quote from: ganeshXL at May 20, 2008, 01:09 PM
        Here’s a basic example of a "csv to modx html table" snippet: http://modxcms.com/forums/index.php/topic,25588.msg156984.html#msg156984

        Cool cool
        Thanks !

        Quote from: ganeshXL
        However, you can’t do sorting on a specific field with this. That’s why it’s almost always better to create a DB-table. Then you can easily ORDER BY foo ASC | DESC etc. It would probably be possible too with a csv, but you’d need to create multidimensional arrays and sort those - or make sure the CSV is already sorted the way you want.

        Or you could use jQuery’s tablesorter to sort the table too
        Of course, that not server side, but it can be a quick and dirty solution, for the lazy ones grin
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l'outil id
          • 4310
          • 2,310 Posts
          @ cbaone I’m just finishing a module based on the existing WebusersImport one.
          So far I have two extra tables of 13 columns & 2 columns in the DB to be updated from inside the Manager via .csv files.
          I’m trying to make it as foolproof as possible for the clients.
          Here’s a screen shot of the progress:
            • 4749
            • 623 Posts
            @ganeshXL:
            Thanks, I actually saw your tutorial this morning. Very great idea, I know I’ll use it at some point. May not be the best for this circumstance, but it is definitely something I’ll use. Great tutorial by the way!

            @davidm:
            Thanks for the jquery advice. I was actually looking at that and it made me curious so I went to the mootools forums and found something that may work in the interim. http://madhatted.com/assets/2008/1/16/minimal_sort_v2_1.html It seems to be pretty slick. But, you’re right it’s just a temporary fix for now.

            @bunk58:
            That definitely does head in the right direction and may be something I could use. I appreciate your sharing. Let me know how it turns out for you.


              The MODx has you...
              Utah Web Design
              • 4310
              • 2,310 Posts
              I’ve finished the csv to db module it’s in the In Development forum for testing and feedback.
                • 4749
                • 623 Posts
                @bunk58:
                Awesome. I’m gonna have to check it out. Thanks for sharing!
                  The MODx has you...
                  Utah Web Design