I added it as the value in the last column in the csv because I seemed to 
have no way to split on new row/line

In other apps one would say split[\n] to indicate newline

Regards
Tony

On Friday, June 28, 2019 at 9:24:53 AM UTC+10, Mark S. wrote:
>
> Where is <eol> coming from?
>
> On Thursday, June 27, 2019 at 3:41:07 PM UTC-7, TonyM wrote:
>>
>> Mark,
>>
>> Thanks, I am using the prerelease and split operator already. After a 
>> nights sleep I tried to take another approach and there is clearly 
>> something I do not understand.
>>
>> Here is what I am doing, 
>>
>>    - I hope others can use successfully, for processing CSV files, 
>>    - but only when I resolve a bug. 
>>    - Oddly I do find various macros but not widgets in TiddlyWiki that 
>>    supposed to parse csv. None of which seems documented at 
>>    tiddlywiki.com, only the export process.
>>
>>
>> I added a tag "<eol>" for end of line to each row in the csv
>>
>> \define each-row(row)
>> $row$<br>
>> \end
>> <$list filter="[{StaffList.csv}split[<eol>]]" variable=input-row>
>>   <$macrocall $name=each-row row=<<input-row>>/>
>> </$list>
>> and I get a list of each row.
>>
>> Then inside the each-row macro above I am adding the following for each 
>> field, where the nth[] is the position in each row.
>> <$set name=fieldname value={{{ [[$row$]split[,]nth[1]] }}} >
>>
>> The full detail for each row is
>> <$set name=person-tiddler value={{{ [[$row$]split[,]nth[1]] }}} >
>> <$set name=first-name value={{{ [[$row$]split[,]nth[2]] }}} >
>> <$set name=surname value={{{ [[$row$]split[,]nth[3]] }}} >
>> <$set name=person-role value={{{ [[$row$]split[,]nth[4]] }}} >
>> <$set name=email-address value={{{ [[$row$]split[,]nth[5]] }}} >
>> <$set name=import-region value={{{ [[$row$]split[,]nth[6]] }}} >
>> Person=<<person-tiddler>>
>> first-name=<<first-name>> 
>> surname=<<surname>> 
>> person-role=<<person-role>> 
>> email-address=<<email-address>> 
>> import-region=<<import-region>>
>> <br><br>
>> </$set></$set></$set></$set></$set></$set>
>> The idea being to extract the nth item in each row and assign it to a 
>> variable
>>
>> *What is ODD is the above actually works for the first row*
>> *I get a nice line of field=value key/value pairs.*
>>
>> However it displays all rows, but never sets the variables ever again, 
>> only for the first case.
>>
>> This is seriously confusing me.
>>
>> Any feedback would be welcome.
>>
>> Regards
>> Tony
>>
>>
>> On Friday, June 28, 2019 at 2:59:27 AM UTC+10, Mark S. wrote:
>>>
>>> Hi Tony,
>>>
>>> The 5.1.20 prerelease has new split operators.
>>>
>>> You could make your CSV tiddler a data tiddler as you suggested. 
>>> Navigate through all the indexes, and split the line by the comma. 
>>> Obviously this will fail if you have any embedded commas, but it should 
>>> work with "regular" data.
>>>
>>> -- Mark
>>>
>>> On Thursday, June 27, 2019 at 7:44:46 AM UTC-7, TonyM wrote:
>>>>
>>>> This was an old request, but I still need to resolve it.
>>>>
>>>>
>>>>    - I have built my own macro csv column to fieldname process
>>>>    - But I do not know how to feed a row at a time from my 
>>>>    csv/datatiddler tiddler to the macro
>>>>    - I tried to make it look like a data tiddler
>>>>       - full name:,firstname,surname,type,email,location
>>>>    - But I still could not get each row with indexes
>>>>
>>>>
>>>> I am lost. All I want to do is process a row of a tiddler at a time. 
>>>> This should not be rocket science.
>>>>
>>>> Thanks in advance if anyone can get me out of this desperate state.
>>>>
>>>> Tony
>>>>
>>>> On Tuesday, March 5, 2019 at 10:41:29 AM UTC+11, TonyM wrote:
>>>>>
>>>>> Folks,
>>>>>
>>>>> I note the addition of a CSV Parser in TW5.1.18 which includes the 
>>>>> csvtiddlers macro for exporting.
>>>>>
>>>>> Is there a new or existing method to import csv files and generate 
>>>>> tiddlers ?
>>>>>
>>>>> I know there is the excel handling tool but wondering if there is a 
>>>>> simpler title - tiddler and all columns to fields 
>>>>>
>>>>> Regards
>>>>> Tony
>>>>>
>>>>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/01781e9d-2d3e-41a2-81b4-0eadfb9f689e%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to