Creating variables from a CSV

I'm trying to take tasks from one todo app to another. 2Do to Things. 2Do has exported a CSV file which contains projects and tasks (children of projects) and completed tasks from those projects as well.

If you can help me to create variables for each of those: Project, Project:ChildTask, Project:ChildTask(Completed), along with time stamps for the completed tasks (included in the CSV), I can probably take it from there.

Thanks! :blush:

sample.csv.zip (4.9 KB)

Wade

There are various regex approaches to reading CSV in other threads on this forums. Given the variation within CSV dialects, however, I personally reach for the Python CSV reader, which does a pretty good job of detecting specific dialects and handling them correctly.

In a KM 'Execute shell script action', for example, something like this:

Hi @ComplexPoint,

I tried this script: “Bind KMvars to CSV data thru Python, JSON” (https://forum.keyboardmaestro.com/uploads/default/original/3X/3/7/378695ca162af320b254949227892ba16c3bf0a3.kmmacros) from the forum link, but according to the output popup, it only appears to grab the first line of the CSV: a project section from the csv and not the subtasks of that project.

Also: how would I use the jsonArrays variable after the script has pushed the CSV into the array?

Not sure what glitch you are hitting – perhaps an unexpected character in the source file, but here, assuming a file like ~/Desktop/sample4.csv

and executing a shell script like:

/usr/local/bin/python3 <<PY_END 2>/dev/null
import os
import csv
import json

def main():
    str_full_path = os.path.expanduser('~/Desktop/sample4.csv')
    if (os.path.exists(str_full_path) and os.path.isfile(str_full_path)):
        with open(str_full_path, newline='') as csvfile:
        
            # Best guess as to variety of CSV, based on sample,
            dialect = csv.Sniffer().sniff(csvfile.read(1024))
            
            # and pointer restored to start of file.
            csvfile.seek(0)
            
            # File parsed and rendered as JSON list of lists
            reader = csv.reader(csvfile, dialect)
            print (json.dumps( [ row for row in reader ] ))
            
    else:
        print ('File not found:', str_full_path )
main()
PY_END

Leads to JSON of the form:

[["TASK", " PROJECT", " LIST", " CREATED", " STARTDATE", " DUEDATE", " DUETIME", " DURATION", " REPEAT", " PRIORITY", " TAG", " LOCATION", " COMPLETED", " COMPLETIONDATE", " STAR", " NOTE"], ["Houdini basics", "", "LEARNING NEXT", "2018-07-03, 1:31 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["LearnDay - Houdini Particles Basics - YouTube", "Houdini basics", "LEARNING NEXT", "2017-12-28, 8:15 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Free Textures | SideFX", "Houdini basics", "LEARNING NEXT", "2018-05-14, 10:38 AM", "", "", "", "", "", "0", "", "", "", "", "", "The following PBR ready textures are available in Houdini's .rat image format. These images are set up in linear space and are tileable. You can also use .tiff versions of the images to build custom textures in Adobe Photoshop, Gimp or any other image editor. Simply browse to the desired texture pack and download the high resolution image packs directly!"], ["Introduction to FX using Houdini with Manuel Tausch | CGWORKSHOPS", "Houdini basics", "LEARNING NEXT", "2018-05-14, 4:32 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["C4D Houdini Engine assets", "Houdini basics", "LEARNING NEXT", "2018-05-18, 5:50 PM", "", "", "", "", "", "0", "", "", "", "", "", "http://www.orbolt.com/search/?q=softpackage:Cinema+4D"], ["Houdini VEX fundamentals", "Houdini basics", "LEARNING NEXT", "2018-05-23, 10:52 PM", "", "", "", "", "", "0", "", "", "", "", "", "https://www.pluralsight.com/courses/houdini-vex-fundamentals"], ["Creating Corrosive Acid Effect using Houdini and Redshift Render - YouTube", "Houdini basics", "LEARNING NEXT", "2018-05-25, 11:49 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["VDBfusion - Procedural Modeling Toolkit", "Houdini basics", "LEARNING NEXT", "2018-06-06, 10:48 PM", "", "", "", "", "", "0", "", "", "", "", "", "Product page: http://www.timvanhelsdingen.com/#!vdbfusion/yj8w8. VDBfusion is a procedural modeling toolkit, kinda like Meshfusion for Modo. I always thought Meshfusion was a great concept, but it's only available for Modo. That is why I decided to try to make my own version using a VDB workflow for Houdini Engine, and make this available for everybody :). It's available for free Gumroad, but of course a donation would be much appreciated! Houdini Engine recently became completely free, so just install it to try this out :). Main features: -Completely non-destructive modeling tools. -Stack multiple VDBfusion instances together to create complex geometry. -A lot of optimization options to get the look you want. If you have any questions or suggestions, let me know!"], ["houdini - Lynda", "Houdini basics", "LEARNING NEXT", "2018-06-09, 1:06 AM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["support AT sidefx.com", "Houdini basics", "LEARNING NEXT", "2018-06-14, 1:03 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Houdini as 2D anim creator (black & white lines, particles, smoke?)", "Houdini basics", "LEARNING NEXT", "2018-08-14, 8:48 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Portfolio overhaul", "", "LEARNING NEXT", "2017-11-27, 2:22 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Take/find a screen video of WorldView in USE (black intro and normal) that\u2019s aesthetic", "Portfolio overhaul", "LEARNING NEXT", "2017-11-14, 9:08 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Portfolio like Pentagram or Frame.dk", "Portfolio overhaul", "LEARNING NEXT", "2017-12-22, 6:06 PM", "", "", "", "", "", "0", "", "", "", "", "", "https://www.pentagram.com\r\nhttps://frame.dk\r\n\r\nLens effects homepage\r\nhttp://mathematic.tv\r\n\r\nCool draggable \u201cdocuments\u201d\r\nhttps://www.herzogdemeuron.com/\r\n\r\nBIG PHOTOS\r\nhttp://concrete.ca"], ["Include that crazy 3D 3-layer pizza you made for PYXIS", "Portfolio overhaul", "LEARNING NEXT", "2017-12-23, 1:32 AM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Check manvsmachine.com \u2014\u00a0Do they darken the screen when video playing? USE THAT on portfolio", "Portfolio overhaul", "LEARNING NEXT", "2018-03-28, 4:15 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Webflow - Changing multiple element styles on scroll", "Portfolio overhaul", "LEARNING NEXT", "2018-03-28, 10:44 PM", "", "", "", "", "", "0", "", "", "", "", "", "Also:\r\nhttps://webflow.com/ecommerce"], ["optimizeLegibility", "Portfolio overhaul", "LEARNING NEXT", "2018-04-12, 1:07 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Add responsive videos to portfolio", "Portfolio overhaul", "LEARNING NEXT", "2018-04-16, 4:11 PM", "", "", "", "", "", "0", "", "", "", "", "", "Portable Human\r\n<style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'><iframe src='https://player.vimeo.com/video/252227138' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>\r\n\r\nTime of Arrival\r\n<style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'><iframe src='https://player.vimeo.com/video/262886158' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>"], ["Send work to Richard Rosenman", "Portfolio overhaul", "LEARNING NEXT", "2018-05-02, 1:00 PM", "", "", "", "", "", "0", "", "", "", "", "", "https://www.linkedin.com/in/richard-rosenman-0b63181/"], ["Zbrush", "", "LEARNING NEXT", "2018-07-03, 1:25 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Zbrush - Hard Surface part 1", "Zbrush", "LEARNING NEXT", "2018-05-27, 10:05 PM", "", "", "", "", "", "0", "", "", "", "", "", "https://www.youtube.com/watch?v=5aYfmhNP-40"], ["Zbrush 10 part course", "Zbrush", "LEARNING NEXT", "2018-06-11, 9:01 AM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Polypaint a Head", "Zbrush", "LEARNING NEXT", "2018-09-09, 9:59 AM", "", "", "", "", "", "0", "", "", "", "", "", "https://m.youtube.com/watch?v=8iAbH3zSQak"], ["Learn To Design Business Experiments That Matter \u2014 Strategyzer", "", "LEARNING NEXT", "2018-03-19, 5:49 PM", "", "", "", "", "", "0", "", "", "", "", "", "We\u2019re going back to the basics to define best practices for running well \r\ndesigned business experiments. We\u2019re also working on a course to teach you \r\nthose best practices, so sign up to get notified when it\u2019s live."], ["Substance Painter/Designer", "", "LEARNING NEXT", "2018-07-17, 11:44 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["C4D", "", "LEARNING NEXT", "2018-07-03, 1:30 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Magic AnimCurve \u2013 Nitro4d", "C4D", "LEARNING NEXT", "2018-04-22, 10:43 AM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Creating Geometry With Python In C4D on Vimeo", "C4D", "LEARNING NEXT", "2018-05-08, 4:25 PM", "", "", "", "", "", "0", "", "", "", "", "", "In this Entagma tutorial, Manuel shows you how to create a plexus style wireframe effect directly in Cinema4D with off the shelf tools using Thinking Particles and\u2026"], ["NitroBake2 \u2013 Nitro4d", "C4D", "LEARNING NEXT", "2018-05-08, 4:33 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["C4D MIDI plugin", "C4D", "LEARNING NEXT", "2018-05-11, 1:02 AM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["AniMidi \u2013 Nitro4d", "C4D", "LEARNING NEXT", "2018-05-11, 1:02 AM", "", "", "", "", "", "0", "", "", "", "", "", "- AniMidi Intro - YouTube\r\nhttps://m.youtube.com/watch?v=m532rYp3rFk\r\n\r\n- AniMidi Number five Tutorials - YouTube\r\nhttps://m.youtube.com/watch?v=iVpPni5jwYE\r\n\r\n- AniMidi Number Second Tutorials - YouTube\r\nhttps://m.youtube.com/watch?v=o84GcHOCtzo\r\n\r\n- AniMidi Number Three Tutorials - YouTube\r\nhttps://m.youtube.com/watch?v=tmWHL2Zxp3w"], ["C4D motion clips", "C4D", "LEARNING NEXT", "2018-05-11, 1:02 AM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Selection objects in C4D are really cool!", "C4D", "LEARNING NEXT", "2018-05-12, 11:28 PM", "", "", "", "", "", "0", "", "", "", "", "", "Select > Selection Filter > Create Selection Object"], ["Merk Vilson tutorials", "C4D", "LEARNING NEXT", "2018-09-09, 8:51 PM", "", "", "", "", "", "0", "", "", "", "", "", "file:///Users/etc/SKWID/3D/_3D_LEARNING/C4D_learning_vids/Merk_Vilson_tutorials"], ["Shapr3D", "", "LEARNING NEXT", "2017-06-23, 5:00 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Read article: Golf machine in Shapr3D", "Shapr3D", "LEARNING NEXT", "2017-08-10, 5:23 PM", "", "", "", "15 m", "", "0", "", "", "", "", "", "http://blog.shapr3d.com/launching-a-kickstarter-product-and-beyond/"], ["Spend 30min watching Shapr3D design school", "Shapr3D", "LEARNING NEXT", "2017-06-21, 3:16 PM", "", "", "", "30 m", "", "0", "", "", "", "", "", ""], ["Watch Shapr3D webinar (bottle design)", "Shapr3D", "LEARNING NEXT", "2018-08-06, 5:56 AM", "", "", "", "", "", "0", "Watch", "", "Yes", "2018-08-06, 5:59 AM", "", ""], ["AE", "", "LEARNING NEXT", "2018-07-03, 10:11 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Control animation black and white", "AE", "LEARNING NEXT", "2018-05-11, 1:02 AM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["GridGuide - aescripts + aeplugins - aescripts.com", "AE", "LEARNING NEXT", "2018-05-31, 10:10 AM", "", "", "", "", "", "0", "", "", "", "", "", "Automatic layouts, snappable guide grids and modifiable shape layer guides - because motion design isn't static."], ["FlexCam for AE - Camera Animation made easy!", "AE", "LEARNING NEXT", "2018-06-06, 10:19 PM", "", "", "", "", "", "0", "", "", "", "", "", "New 1.0 update! Better camera settings, better wiggle, wiggle checkbox, and more! Check out the tutorial to see all of the changes. FlexCam is a After effects template that greatly improves the After Effects camera animation workflow. Never struggle with camera animation ever again! FlexCam is a 'Pay what you want' template. Meaning you can decide for yourself what you pay! Product overview video: https://vimeo.com/118064965. FlexCam tutorial: https://vimeo.com/117850684. Like me on facebook to keep up to date: facebook.com/timvanhelsdingen3d. For more information and other future templates: timvanhelsdingen.com. Template features: -Click and drag camera controls. -Independent axis control. -Keep objects always in focus, even if camera moves. -Copy/paste position data to focus on objects. -Hotbox controls for intuitive animaton. -2 build in wiggle types: Smooth & rigid. -Wiggle checkbox. -Adjustable camera rotation point. -Build in vignetting options. -works on ANY resolution and aspect ratio! -Works in After effects CS5 and up"], ["Modo", "", "LEARNING NEXT", "2017-11-26, 11:45 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Find utility (Watch Tor Frick) to map mouse wheel to keys (instead of Z/X), like", "Modo", "LEARNING NEXT", "2018-07-10, 8:34 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Richard Yot denoising protocol?", "Modo", "LEARNING NEXT", "2017-11-08, 7:53 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Assign keys: Rotate to script moving  new geometry just created", "Modo", "LEARNING NEXT", "2017-11-12, 11:15 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["How to make the Mac Command key work in modo | Foundry Community", "Modo", "LEARNING NEXT", "2017-11-15, 5:13 PM", "", "", "", "", "", "0", "", "", "", "", "", "https://vimeo.com/51800259"], ["Checkout Super_UV tools", "Modo", "LEARNING NEXT", "2017-11-20, 9:24 AM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Look at Hatchet tool collection videos", "Modo", "LEARNING NEXT", "2018-04-22, 9:49 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["MODO Learn", "Modo", "LEARNING NEXT", "2018-07-08, 1:17 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Create selection set hotkeys for Modo", "Modo", "LEARNING NEXT", "2017-11-21, 12:35 AM", "", "", "", "", "", "0", "", "", "Yes", "2017-12-01, 2:57 PM", "", ""], ["Make a hot key for meshOp Add Operator dialog", "Modo", "LEARNING NEXT", "2017-11-21, 7:34 PM", "", "", "", "", "", "0", "", "", "Yes", "2017-12-01, 2:46 PM", "", ""], ["Swift", "", "LEARNING NEXT", "2018-07-03, 9:32 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["iOS Retain Cycles", "Swift", "LEARNING NEXT", "2018-04-23, 9:58 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["iOS 11: NLP with Core ML | Ray Wenderlich Videos", "Swift", "LEARNING NEXT", "2018-05-03, 10:40 PM", "", "", "", "", "", "0", "", "", "", "", "", "Discover how Core ML in iOS 11 makes NLP highly accessible with this screencast, as you learn how to perform sentiment analysis on movie reviews."], ["ternary operators in swift ? \u2014\u00a0example: titleLabel.text = menuIsOpen ? \"Select Item\"\" : \"\"Packing List\"\"\"", "Swift", "LEARNING NEXT", "2018-05-13, 10:37 PM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["Ableton Live 10", "", "LEARNING NEXT", "2018-09-10, 10:08 AM", "", "", "", "", "", "0", "", "", "", "", "", ""], ["How to Organize Your Plugins in Ableton Live 10 \u2013 Matthew Vere \u2013 Medium", "Ableton Live 10", "LEARNING NEXT", "2018-09-05, 12:49 PM", "", "", "", "", "", "0", "", "", "", "", "", "This post is a further exploration of an previous entry I made, on how I organise my plugin and sample library. I have received many requests to cover the plugin section again, in further detail\u2026"], ["I am COMPLETED 3", "", "LEARNING NEXT", "2018-10-16, 9:37 AM", "", "", "", "", "", "0", "", "", "Yes", "2018-10-16, 9:38 AM", "", "We\u2019re going back to the basics to define best practices for running well \r\ndesigned business experiments. We\u2019re also working on a course to teach you \r\nthose best practices, so sign up to get notified when it\u2019s live."], ["I am COMPLETED 2", "", "LEARNING NEXT", "2018-10-16, 9:37 AM", "", "", "", "", "", "0", "", "", "Yes", "2018-10-16, 9:38 AM", "", "We\u2019re going back to the basics to define best practices for running well \r\ndesigned business experiments. We\u2019re also working on a course to teach you \r\nthose best practices, so sign up to get notified when it\u2019s live."], ["I am COMPLETED 1", "", "LEARNING NEXT", "2018-10-16, 9:37 AM", "", "", "", "", "", "0", "", "", "Yes", "2018-10-16, 9:38 AM", "", "We\u2019re going back to the basics to define best practices for running well \r\ndesigned business experiments. We\u2019re also working on a course to teach you \r\nthose best practices, so sign up to get notified when it\u2019s live."]]

and if we execute a JXA script on that, using code like:

(() => {
  'use strict';

  const main = () => {

    const rows = [
      ["TASK", " PROJECT", " LIST", " CREATED", " STARTDATE", " DUEDATE", " DUETIME", " DURATION", " REPEAT", " PRIORITY", " TAG", " LOCATION", " COMPLETED", " COMPLETIONDATE", " STAR", " NOTE"],
      ["Houdini basics", "", "LEARNING NEXT", "2018-07-03, 1:31 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["LearnDay - Houdini Particles Basics - YouTube", "Houdini basics", "LEARNING NEXT", "2017-12-28, 8:15 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Free Textures | SideFX", "Houdini basics", "LEARNING NEXT", "2018-05-14, 10:38 AM", "", "", "", "", "", "0", "", "", "", "", "", "The following PBR ready textures are available in Houdini's .rat image format. These images are set up in linear space and are tileable. You can also use .tiff versions of the images to build custom textures in Adobe Photoshop, Gimp or any other image editor. Simply browse to the desired texture pack and download the high resolution image packs directly!"],
      ["Introduction to FX using Houdini with Manuel Tausch | CGWORKSHOPS", "Houdini basics", "LEARNING NEXT", "2018-05-14, 4:32 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["C4D Houdini Engine assets", "Houdini basics", "LEARNING NEXT", "2018-05-18, 5:50 PM", "", "", "", "", "", "0", "", "", "", "", "", "http://www.orbolt.com/search/?q=softpackage:Cinema+4D"],
      ["Houdini VEX fundamentals", "Houdini basics", "LEARNING NEXT", "2018-05-23, 10:52 PM", "", "", "", "", "", "0", "", "", "", "", "", "https://www.pluralsight.com/courses/houdini-vex-fundamentals"],
      ["Creating Corrosive Acid Effect using Houdini and Redshift Render - YouTube", "Houdini basics", "LEARNING NEXT", "2018-05-25, 11:49 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["VDBfusion - Procedural Modeling Toolkit", "Houdini basics", "LEARNING NEXT", "2018-06-06, 10:48 PM", "", "", "", "", "", "0", "", "", "", "", "", "Product page: http://www.timvanhelsdingen.com/#!vdbfusion/yj8w8. VDBfusion is a procedural modeling toolkit, kinda like Meshfusion for Modo. I always thought Meshfusion was a great concept, but it's only available for Modo. That is why I decided to try to make my own version using a VDB workflow for Houdini Engine, and make this available for everybody :). It's available for free Gumroad, but of course a donation would be much appreciated! Houdini Engine recently became completely free, so just install it to try this out :). Main features: -Completely non-destructive modeling tools. -Stack multiple VDBfusion instances together to create complex geometry. -A lot of optimization options to get the look you want. If you have any questions or suggestions, let me know!"],
      ["houdini - Lynda", "Houdini basics", "LEARNING NEXT", "2018-06-09, 1:06 AM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["support AT sidefx.com", "Houdini basics", "LEARNING NEXT", "2018-06-14, 1:03 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Houdini as 2D anim creator (black & white lines, particles, smoke?)", "Houdini basics", "LEARNING NEXT", "2018-08-14, 8:48 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Portfolio overhaul", "", "LEARNING NEXT", "2017-11-27, 2:22 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Take/find a screen video of WorldView in USE (black intro and normal) that\u2019s aesthetic", "Portfolio overhaul", "LEARNING NEXT", "2017-11-14, 9:08 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Portfolio like Pentagram or Frame.dk", "Portfolio overhaul", "LEARNING NEXT", "2017-12-22, 6:06 PM", "", "", "", "", "", "0", "", "", "", "", "", "https://www.pentagram.com\r\nhttps://frame.dk\r\n\r\nLens effects homepage\r\nhttp://mathematic.tv\r\n\r\nCool draggable \u201cdocuments\u201d\r\nhttps://www.herzogdemeuron.com/\r\n\r\nBIG PHOTOS\r\nhttp://concrete.ca"],
      ["Include that crazy 3D 3-layer pizza you made for PYXIS", "Portfolio overhaul", "LEARNING NEXT", "2017-12-23, 1:32 AM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Check manvsmachine.com \u2014\u00a0Do they darken the screen when video playing? USE THAT on portfolio", "Portfolio overhaul", "LEARNING NEXT", "2018-03-28, 4:15 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Webflow - Changing multiple element styles on scroll", "Portfolio overhaul", "LEARNING NEXT", "2018-03-28, 10:44 PM", "", "", "", "", "", "0", "", "", "", "", "", "Also:\r\nhttps://webflow.com/ecommerce"],
      ["optimizeLegibility", "Portfolio overhaul", "LEARNING NEXT", "2018-04-12, 1:07 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Add responsive videos to portfolio", "Portfolio overhaul", "LEARNING NEXT", "2018-04-16, 4:11 PM", "", "", "", "", "", "0", "", "", "", "", "", "Portable Human\r\n<style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'><iframe src='https://player.vimeo.com/video/252227138' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>\r\n\r\nTime of Arrival\r\n<style>.embed-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; } .embed-container iframe, .embed-container object, .embed-container embed { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }</style><div class='embed-container'><iframe src='https://player.vimeo.com/video/262886158' frameborder='0' webkitAllowFullScreen mozallowfullscreen allowFullScreen></iframe></div>"],
      ["Send work to Richard Rosenman", "Portfolio overhaul", "LEARNING NEXT", "2018-05-02, 1:00 PM", "", "", "", "", "", "0", "", "", "", "", "", "https://www.linkedin.com/in/richard-rosenman-0b63181/"],
      ["Zbrush", "", "LEARNING NEXT", "2018-07-03, 1:25 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Zbrush - Hard Surface part 1", "Zbrush", "LEARNING NEXT", "2018-05-27, 10:05 PM", "", "", "", "", "", "0", "", "", "", "", "", "https://www.youtube.com/watch?v=5aYfmhNP-40"],
      ["Zbrush 10 part course", "Zbrush", "LEARNING NEXT", "2018-06-11, 9:01 AM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Polypaint a Head", "Zbrush", "LEARNING NEXT", "2018-09-09, 9:59 AM", "", "", "", "", "", "0", "", "", "", "", "", "https://m.youtube.com/watch?v=8iAbH3zSQak"],
      ["Learn To Design Business Experiments That Matter \u2014 Strategyzer", "", "LEARNING NEXT", "2018-03-19, 5:49 PM", "", "", "", "", "", "0", "", "", "", "", "", "We\u2019re going back to the basics to define best practices for running well \r\ndesigned business experiments. We\u2019re also working on a course to teach you \r\nthose best practices, so sign up to get notified when it\u2019s live."],
      ["Substance Painter/Designer", "", "LEARNING NEXT", "2018-07-17, 11:44 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["C4D", "", "LEARNING NEXT", "2018-07-03, 1:30 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Magic AnimCurve \u2013 Nitro4d", "C4D", "LEARNING NEXT", "2018-04-22, 10:43 AM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Creating Geometry With Python In C4D on Vimeo", "C4D", "LEARNING NEXT", "2018-05-08, 4:25 PM", "", "", "", "", "", "0", "", "", "", "", "", "In this Entagma tutorial, Manuel shows you how to create a plexus style wireframe effect directly in Cinema4D with off the shelf tools using Thinking Particles and\u2026"],
      ["NitroBake2 \u2013 Nitro4d", "C4D", "LEARNING NEXT", "2018-05-08, 4:33 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["C4D MIDI plugin", "C4D", "LEARNING NEXT", "2018-05-11, 1:02 AM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["AniMidi \u2013 Nitro4d", "C4D", "LEARNING NEXT", "2018-05-11, 1:02 AM", "", "", "", "", "", "0", "", "", "", "", "", "- AniMidi Intro - YouTube\r\nhttps://m.youtube.com/watch?v=m532rYp3rFk\r\n\r\n- AniMidi Number five Tutorials - YouTube\r\nhttps://m.youtube.com/watch?v=iVpPni5jwYE\r\n\r\n- AniMidi Number Second Tutorials - YouTube\r\nhttps://m.youtube.com/watch?v=o84GcHOCtzo\r\n\r\n- AniMidi Number Three Tutorials - YouTube\r\nhttps://m.youtube.com/watch?v=tmWHL2Zxp3w"],
      ["C4D motion clips", "C4D", "LEARNING NEXT", "2018-05-11, 1:02 AM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Selection objects in C4D are really cool!", "C4D", "LEARNING NEXT", "2018-05-12, 11:28 PM", "", "", "", "", "", "0", "", "", "", "", "", "Select > Selection Filter > Create Selection Object"],
      ["Merk Vilson tutorials", "C4D", "LEARNING NEXT", "2018-09-09, 8:51 PM", "", "", "", "", "", "0", "", "", "", "", "", "file:///Users/etc/SKWID/3D/_3D_LEARNING/C4D_learning_vids/Merk_Vilson_tutorials"],
      ["Shapr3D", "", "LEARNING NEXT", "2017-06-23, 5:00 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Read article: Golf machine in Shapr3D", "Shapr3D", "LEARNING NEXT", "2017-08-10, 5:23 PM", "", "", "", "15 m", "", "0", "", "", "", "", "", "http://blog.shapr3d.com/launching-a-kickstarter-product-and-beyond/"],
      ["Spend 30min watching Shapr3D design school", "Shapr3D", "LEARNING NEXT", "2017-06-21, 3:16 PM", "", "", "", "30 m", "", "0", "", "", "", "", "", ""],
      ["Watch Shapr3D webinar (bottle design)", "Shapr3D", "LEARNING NEXT", "2018-08-06, 5:56 AM", "", "", "", "", "", "0", "Watch", "", "Yes", "2018-08-06, 5:59 AM", "", ""],
      ["AE", "", "LEARNING NEXT", "2018-07-03, 10:11 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Control animation black and white", "AE", "LEARNING NEXT", "2018-05-11, 1:02 AM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["GridGuide - aescripts + aeplugins - aescripts.com", "AE", "LEARNING NEXT", "2018-05-31, 10:10 AM", "", "", "", "", "", "0", "", "", "", "", "", "Automatic layouts, snappable guide grids and modifiable shape layer guides - because motion design isn't static."],
      ["FlexCam for AE - Camera Animation made easy!", "AE", "LEARNING NEXT", "2018-06-06, 10:19 PM", "", "", "", "", "", "0", "", "", "", "", "", "New 1.0 update! Better camera settings, better wiggle, wiggle checkbox, and more! Check out the tutorial to see all of the changes. FlexCam is a After effects template that greatly improves the After Effects camera animation workflow. Never struggle with camera animation ever again! FlexCam is a 'Pay what you want' template. Meaning you can decide for yourself what you pay! Product overview video: https://vimeo.com/118064965. FlexCam tutorial: https://vimeo.com/117850684. Like me on facebook to keep up to date: facebook.com/timvanhelsdingen3d. For more information and other future templates: timvanhelsdingen.com. Template features: -Click and drag camera controls. -Independent axis control. -Keep objects always in focus, even if camera moves. -Copy/paste position data to focus on objects. -Hotbox controls for intuitive animaton. -2 build in wiggle types: Smooth & rigid. -Wiggle checkbox. -Adjustable camera rotation point. -Build in vignetting options. -works on ANY resolution and aspect ratio! -Works in After effects CS5 and up"],
      ["Modo", "", "LEARNING NEXT", "2017-11-26, 11:45 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Find utility (Watch Tor Frick) to map mouse wheel to keys (instead of Z/X), like", "Modo", "LEARNING NEXT", "2018-07-10, 8:34 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Richard Yot denoising protocol?", "Modo", "LEARNING NEXT", "2017-11-08, 7:53 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Assign keys: Rotate to script moving  new geometry just created", "Modo", "LEARNING NEXT", "2017-11-12, 11:15 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["How to make the Mac Command key work in modo | Foundry Community", "Modo", "LEARNING NEXT", "2017-11-15, 5:13 PM", "", "", "", "", "", "0", "", "", "", "", "", "https://vimeo.com/51800259"],
      ["Checkout Super_UV tools", "Modo", "LEARNING NEXT", "2017-11-20, 9:24 AM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Look at Hatchet tool collection videos", "Modo", "LEARNING NEXT", "2018-04-22, 9:49 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["MODO Learn", "Modo", "LEARNING NEXT", "2018-07-08, 1:17 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Create selection set hotkeys for Modo", "Modo", "LEARNING NEXT", "2017-11-21, 12:35 AM", "", "", "", "", "", "0", "", "", "Yes", "2017-12-01, 2:57 PM", "", ""],
      ["Make a hot key for meshOp Add Operator dialog", "Modo", "LEARNING NEXT", "2017-11-21, 7:34 PM", "", "", "", "", "", "0", "", "", "Yes", "2017-12-01, 2:46 PM", "", ""],
      ["Swift", "", "LEARNING NEXT", "2018-07-03, 9:32 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["iOS Retain Cycles", "Swift", "LEARNING NEXT", "2018-04-23, 9:58 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["iOS 11: NLP with Core ML | Ray Wenderlich Videos", "Swift", "LEARNING NEXT", "2018-05-03, 10:40 PM", "", "", "", "", "", "0", "", "", "", "", "", "Discover how Core ML in iOS 11 makes NLP highly accessible with this screencast, as you learn how to perform sentiment analysis on movie reviews."],
      ["ternary operators in swift ? \u2014\u00a0example: titleLabel.text = menuIsOpen ? \"Select Item\"\" : \"\"Packing List\"\"\"", "Swift", "LEARNING NEXT", "2018-05-13, 10:37 PM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["Ableton Live 10", "", "LEARNING NEXT", "2018-09-10, 10:08 AM", "", "", "", "", "", "0", "", "", "", "", "", ""],
      ["How to Organize Your Plugins in Ableton Live 10 \u2013 Matthew Vere \u2013 Medium", "Ableton Live 10", "LEARNING NEXT", "2018-09-05, 12:49 PM", "", "", "", "", "", "0", "", "", "", "", "", "This post is a further exploration of an previous entry I made, on how I organise my plugin and sample library. I have received many requests to cover the plugin section again, in further detail\u2026"],
      ["I am COMPLETED 3", "", "LEARNING NEXT", "2018-10-16, 9:37 AM", "", "", "", "", "", "0", "", "", "Yes", "2018-10-16, 9:38 AM", "", "We\u2019re going back to the basics to define best practices for running well \r\ndesigned business experiments. We\u2019re also working on a course to teach you \r\nthose best practices, so sign up to get notified when it\u2019s live."],
      ["I am COMPLETED 2", "", "LEARNING NEXT", "2018-10-16, 9:37 AM", "", "", "", "", "", "0", "", "", "Yes", "2018-10-16, 9:38 AM", "", "We\u2019re going back to the basics to define best practices for running well \r\ndesigned business experiments. We\u2019re also working on a course to teach you \r\nthose best practices, so sign up to get notified when it\u2019s live."],
      ["I am COMPLETED 1", "", "LEARNING NEXT", "2018-10-16, 9:37 AM", "", "", "", "", "", "0", "", "", "Yes", "2018-10-16, 9:38 AM", "", "We\u2019re going back to the basics to define best practices for running well \r\ndesigned business experiments. We\u2019re also working on a course to teach you \r\nthose best practices, so sign up to get notified when it\u2019s live."]
    ]


    const
      header = rows[0],
      tasks = rows.slice(1),
      dctKey = header.reduce((a, k, i) => Object.assign(a, {
        [strip(k)]: i
      }), {});

    return map(
      row => row[dctKey['PROJECT']] + ' :: ' + row[dctKey['TASK']] +
      ' completed::' + row[dctKey['COMPLETIONDATE']],
      tasks
    ).join('\n')

  };

  // GENERIC FUNCTIONS ----------------------------
  // https://github.com/RobTrew/prelude-jxa

  // map :: (a -> b) -> [a] -> [b]
  const map = (f, xs) => xs.map(f);

  // strip :: String -> String
  const strip = s => s.trim();

  // MAIN ---
  return main();
})();

Then we can build arbitrary output strings.

@ComplexPoint: Thanks so much for the post. Unfortunately, I'm very new to code like this. I can drag in a JXA (Execute JavaSscript for Automation) box but I'm not sure whether to copy and paste what you posted or just a subsection of it for the JXA script. If I misunderstood, I apologize, some of this stuff is way over my head.

Would you mind posting an example KM macro?

Thanks in advance!

Have you installed / can you install Python 3 ?

( The multiline free text notes in your exported CSV, including commas and other punctuation, make it a bit of a stretch for a regex )

Assuming that you have converted the CSV to JSON, and have saved it, for example to a filepath like ~/Desktop/sample.json

You could run a macro like this, which (on the system here) takes c 5 seconds to bring the material into Things through the Apple Event interface:

JSON to Things.kmmacros (21.6 KB)

things

1 Like

Thanks so much for your help on this @ComplexPoint ! Yes, I have installed Python 3.7.0.
I just tested this with Things 3 and it's bringing todos but it seems to have a few errors.

  • Completed tasks are not being marked as such in Things when imported (from the completion date in the CSV)
  • Tasks inside of projects all seem to be marked as completed in Things but without a completion date showing in Things (maybe Things doesn't understand the date formatting?)
  • Tasks do not have tags from CSV included

This CSV:

TASK, PROJECT, LIST, CREATED, STARTDATE, DUEDATE, DUETIME, DURATION, REPEAT, PRIORITY, TAG, LOCATION, COMPLETED, COMPLETIONDATE, STAR, NOTE
I am a Project,"",TEST AREA,"2018-10-21, 3:35 PM","","","","","",0,I am PROJECT TAG,"","","","",testing project notes
I am task 1 - NOT COMPLETED,I am a Project,TEST AREA,"2018-10-21, 3:36 PM","","","","","",0,"","","","","",I am notes
I am task 2 - NOT COMPLETED,I am a Project,TEST AREA,"2018-10-21, 3:36 PM","","","","","",0,"","","","","",I am notes
I am task 3 - COMPLETED,I am a Project,TEST AREA,"2018-10-21, 3:36 PM","","","","","",0,I am TAG,"",Yes,"2018-10-21, 3:37 PM","",I am notes

Converts to this JSON:

[["\ufeffTASK", " PROJECT", " LIST", " CREATED", " STARTDATE", " DUEDATE", " DUETIME", " DURATION", " REPEAT", " PRIORITY", " TAG", " LOCATION", " COMPLETED", " COMPLETIONDATE", " STAR", " NOTE"], ["I am a Project", "", "TEST AREA", "2018-10-21, 3:35 PM", "", "", "", "", "", "0", "I am PROJECT TAG", "", "", "", "", "testing project notes"], ["I am task 1 - NOT COMPLETED", "I am a Project", "TEST AREA", "2018-10-21, 3:36 PM", "", "", "", "", "", "0", "", "", "", "", "", "I am notes"], ["I am task 2 - NOT COMPLETED", "I am a Project", "TEST AREA", "2018-10-21, 3:36 PM", "", "", "", "", "", "0", "", "", "", "", "", "I am notes"], ["I am task 3 - COMPLETED", "I am a Project", "TEST AREA", "2018-10-21, 3:36 PM", "", "", "", "", "", "0", "I am TAG", "", "Yes", "2018-10-21, 3:37 PM", "", "I am notes"]]

Yes – that code doesn't aim to import all the fields, but if you look at the pattern in the JS, you should be able to update it to map the source fields that interest you to the Things properties which you want them to correspond to.

( I'm not a user of either of those applications, myself, so I just made a first rough guess about relevance and correspondences )

Okay, will do, thanks for you amazing help!

Can you tell why tasks within Project are being marked as completed?

Can you tell why tasks within Project are being marked as completed?

The current sketch needs to be adjusted to make the setting of completion date in Things conditional on whether that CSV field contains data or not.

Perhaps, in the Todos section, something like:

toDos.push(
    things.ToDo({
        name: strTask,
        project: projects.byName(proj),
        notes: cols[col.NOTE],
        completionDate: Boolean(cols[col.COMPLETIONDATE]) ? (
            new Date(cols[col.COMPLETIONDATE])
        ) : undefined
    })
)