import of csv files
Hey guys,
i need to write word list which all have different lenghts. At the moment im doing it in excel and its quite complicated to output them in the right csv formation (i imitated the one from the introduction samples reffered by the documentation). The second problem is that the lists that are shorter then the longest list are filled with blank spaces which is making the list longer than it actually is. I attached screenshots to illustrate the procedure and my issues with it.
So my two questions are:
1. Is there an eassy way to create this kind of csv files?
2. How can i eliminate the blank spaces so that i hace a list with only the elements that are actually in the list?
I would be glad if someone would have any advice.
Thanks for your help!
Tim
-
original_list.jpg 519 KB
-
csv_file_in_exel.jpg 898 KB
-
imported_csv_file.jpg 357 KB
-
list_to_long.jpg 209 KB
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by john on 15 Dec, 2015 12:24 AM
Hi Tim,
There are two ways of doing this.
Method 1. Rearrange your csv file so that instead of one column for each property, you have just two columns, one called "Label" and the other called "Value". You can then enter each label/value pair with no empty cells (see attached screenshot).
To retrieve a list of values for any given property, just attach a filter_data node, set the Key port to "Label" and the Value port to your property name (form, material, etc.). This will give you a list of label/value pairs for that property. To get just the value, attach a lookup node and set its Key port to "Value".
Method 2. Leave your csv file exactly as it is and just strip off the null values. To do this, first do a lookup on the desired property (as you already did in your final screenshot).
To remove the null values, attach two equals nodes one after the other. Connect your lookup node to the first equals and leave its Equals port empty; this will return a list of booleans: true if empty, false if anything else. To negate this, attach the second equals node, this time setting the Equals port to "false".
You will now have a list of booleans that are false for each empty value. Attach your lookup node and this list of booleans to a cull node. This will remove all the empty values.
In addition to the screenshot, I am attaching two csv files and a sample NodeBox network that demonstrates both methods. Propery1.csv shows how to arrange the data for method 1, property2.csv is a simplified version of your current layout. Property_Lists.ndbx shows both methods side by side.
Hope that helps!
John
2 Posted by Tim on 15 Dec, 2015 12:02 PM
Hey John,
thansk for your quick and elaborate help this was exactly what i was looking for! =)
Cheers,
Tim