[Cuis] CSV Parser in Cuis?

H. Hirzel hannes.hirzel at gmail.com
Sat May 9 09:58:23 CDT 2015


Or put the question another way: Would it be fine to have a #join
function is Cuis.
Alternatively I can construct a test helper function which constructs
the test data.





On 5/9/15, H. Hirzel <hannes.hirzel at gmail.com> wrote:
> Here is the result of a first step of porting
>
> https://github.com/hhzl/Cuis-NeoCSV
>
> 48 out of 50 tests have an error. This is mainly because of the way
> the test data is constructed.
>
> input := (String crlf join: #( '"x","y","z"' '100,200,300'
> '100,200,300' '100,200,300' '')).
>
>
> #crlf of Pharo 4.0 may be replaced with #crlfString of Cuis, see below
>
> But Cuis does not have #SequencableCollection>>join
>
>
> What are your suggestions how to proceed? It is about construction of test
> data.
>
>
> --Hannes
>
>
>
> Pharo
> crlf
> 	"Answer a string containing a carriage return and a linefeed."
>
> 	^ self with: Character cr with: Character lf
>
>
> Cuis
>
> crlfString
> 	"Answer a string containing a carriage return and a linefeed."
>
> 	^ self with: Character cr with: Character lf
>
>
>
> Pharo class #SequencableCollection
>
> join: aCollection
> 	"NB: this implementation only works for Array, since WriteStreams
> only work for Arrays and Strings. (!)
> 	Overridden in OrderedCollection and SortedCollection."
> 	^ self class
> 		streamContents: [:stream | aCollection
> 				do: [:each | each joinTo: stream]
> 				separatedBy: [stream nextPutAll: self]]
>
>
>
>
>
> On 5/9/15, H. Hirzel <hannes.hirzel at gmail.com> wrote:
>> I understand that I need to click 'Install' in the file browser to get
>> a separate ChangeSet object.
>>
>> https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/master/Documentation/CodeManagementInCuis.md#loading-changeset-files-into-cuis
>>
>>
>> And it that works well and after some fixes. I do in the Package tool
>>     'Create Package'
>>
>> https://github.com/Cuis-Smalltalk/Cuis-Smalltalk-Dev/blob/master/Documentation/CodeManagementInCuis.md#packages
>>
>> --Hannes
>>
>> On 5/9/15, H. Hirzel <hannes.hirzel at gmail.com> wrote:
>>> And it comes with documentation
>>>
>>> https://github.com/svenvc/docs/blob/master/neo/neo-csv-paper.md
>>>
>>> "CSV is a lightweight text-based de facto standard for human-readable
>>> tabular data interchange."
>>>
>>> On 5/9/15, H. Hirzel <hannes.hirzel at gmail.com> wrote:
>>>> Yes, I assume so as well. Thank you for the note about line
>>>> terminators.
>>>>
>>>> There is also the Pharo Neo-CSV parser which comes with many tests.
>>>>
>>>> https://github.com/svenvc/NeoCVS
>>>>
>>>> It is probably easier to take a Pharo 4.0 image, load NeoCSV in one
>>>> click and file out the class categories
>>>>
>>>> Neo-CSV-Core
>>>> Neo-CSV-Tests
>>>>
>>>> --Hannes
>>>>
>>>> On 5/9/15, Juan Vuletich <juan at jvuletich.org> wrote:
>>>>> Porting any of them shouldn't be hard. You need, as usual, to take
>>>>> into
>>>>> account that Squeak and Pharo uses #cr as line terminator, while Cuis
>>>>> uses #lf.
>>>>>
>>>>> In any case, check ExtendedClipboard.pck.st, and maybe extend it.
>>>>>
>>>>> Cheers,
>>>>> Juan Vuletich
>>>>>
>>>>> On 09/05/2015 06:32 a.m., H. Hirzel wrote:
>>>>>> P.S: I'd like the input to come from the clipboard. This is
>>>>>>
>>>>>> 1. Select a range of cells in a spreadsheet (MSExcel / Libreoffice
>>>>>> calc)
>>>>>> 2. Copy to clipboard
>>>>>> 3. Bring the Cuis window to the front
>>>>>> 4. Press a 'paste data from Excel' button
>>>>>>
>>>>>> In Cuis some processing will be done and the result will be put back
>>>>>> into the clipboard
>>>>>>
>>>>>>
>>>>>> On 5/9/15, H. Hirzel<hannes.hirzel at gmail.com>  wrote:
>>>>>>> Dear all
>>>>>>>
>>>>>>> has anyone written or ported a CSV parser to Cuis?
>>>>>>>
>>>>>>> For example this one
>>>>>>>
>>>>>>> http://www.squeaksource.com/@BiTWvEAxOgxLE9wJ/T0wdhSm3
>>>>>>>
>>>>>>> Description: A simple parser for comma-separated-value files.
>>>>>>> Creator:	Avi Bryant
>>>>>>>
>>>>>>> Regards
>>>>>>>
>>>>>>> Hannes Hirzel
>>>>>>>
>>>>>> _______________________________________________
>>>>>> Cuis mailing list
>>>>>> Cuis at jvuletich.org
>>>>>> http://jvuletich.org/mailman/listinfo/cuis_jvuletich.org
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>




More information about the Cuis mailing list