[CSV] CSVMutableRecord
Hi Everyone, I recently pushed a change(pull request 20) to get the line ending from the parser. Now I want to push another change which I feel will also be useful for the community. I want to add a CSVRecordMutable class which had a constructor which accepts a CSVRecord object. So when we have a CSVRecordMutable object from it then we can edit individual columns using it. I would be using this to write back my edited CSV file. My use case is to read a csv, mangle some columns, write back a new csv. I could have directly raised a pull request but I just wanted to float the idea before and see the reaction. Thanks Nitin
Re: [CSV] CSVMutableRecord
Hi All: Should we consider adding put(int,Object) and put(String, Object) to the current CSVRecord class? Gary On Mon, Aug 14, 2017 at 2:54 PM, nitin mahendru wrote: > Hi Everyone, > > I recently pushed a change(pull request 20) to get the line ending from the > parser. > > Now I want to push another change which I feel will also be useful for the > community. I want to add a CSVRecordMutable class which had a constructor > which accepts a CSVRecord object. So when we have a CSVRecordMutable object > from it then we can edit individual columns using it. > > I would be using this to write back my edited CSV file. My use case is to > read a csv, mangle some columns, write back a new csv. > > I could have directly raised a pull request but I just wanted to float the > idea before and see the reaction. > > Thanks > > Nitin >
Re: [CSV] CSVMutableRecord
Yeah that also is OK. I though there is a reason to keep the CSVRecord without setters. But maybe not! Nitin On Mon, Aug 14, 2017 at 2:22 PM Gary Gregory wrote: > Hi All: > > Should we consider adding put(int,Object) and put(String, Object) to the > current CSVRecord class? > > Gary > > On Mon, Aug 14, 2017 at 2:54 PM, nitin mahendru < > nitin.mahendr...@gmail.com> > wrote: > > > Hi Everyone, > > > > I recently pushed a change(pull request 20) to get the line ending from > the > > parser. > > > > Now I want to push another change which I feel will also be useful for > the > > community. I want to add a CSVRecordMutable class which had a constructor > > which accepts a CSVRecord object. So when we have a CSVRecordMutable > object > > from it then we can edit individual columns using it. > > > > I would be using this to write back my edited CSV file. My use case is to > > read a csv, mangle some columns, write back a new csv. > > > > I could have directly raised a pull request but I just wanted to float > the > > idea before and see the reaction. > > > > Thanks > > > > Nitin > > >
Re: [CSV] CSVMutableRecord
I think we've kept the design as YAGNI as possible... :-) Gary On Mon, Aug 14, 2017 at 3:25 PM, nitin mahendru wrote: > Yeah that also is OK. I though there is a reason to keep the CSVRecord > without setters. But maybe not! > > Nitin > > > > > On Mon, Aug 14, 2017 at 2:22 PM Gary Gregory > wrote: > > > Hi All: > > > > Should we consider adding put(int,Object) and put(String, Object) to the > > current CSVRecord class? > > > > Gary > > > > On Mon, Aug 14, 2017 at 2:54 PM, nitin mahendru < > > nitin.mahendr...@gmail.com> > > wrote: > > > > > Hi Everyone, > > > > > > I recently pushed a change(pull request 20) to get the line ending from > > the > > > parser. > > > > > > Now I want to push another change which I feel will also be useful for > > the > > > community. I want to add a CSVRecordMutable class which had a > constructor > > > which accepts a CSVRecord object. So when we have a CSVRecordMutable > > object > > > from it then we can edit individual columns using it. > > > > > > I would be using this to write back my edited CSV file. My use case is > to > > > read a csv, mangle some columns, write back a new csv. > > > > > > I could have directly raised a pull request but I just wanted to float > > the > > > idea before and see the reaction. > > > > > > Thanks > > > > > > Nitin > > > > > >
Re: [CSV] CSVMutableRecord
Feel free to provide a PR on GitHub :-) Gary On Aug 14, 2017 15:29, "Gary Gregory" wrote: > I think we've kept the design as YAGNI as possible... :-) > > Gary > > On Mon, Aug 14, 2017 at 3:25 PM, nitin mahendru < > nitin.mahendr...@gmail.com> wrote: > >> Yeah that also is OK. I though there is a reason to keep the CSVRecord >> without setters. But maybe not! >> >> Nitin >> >> >> >> >> On Mon, Aug 14, 2017 at 2:22 PM Gary Gregory >> wrote: >> >> > Hi All: >> > >> > Should we consider adding put(int,Object) and put(String, Object) to the >> > current CSVRecord class? >> > >> > Gary >> > >> > On Mon, Aug 14, 2017 at 2:54 PM, nitin mahendru < >> > nitin.mahendr...@gmail.com> >> > wrote: >> > >> > > Hi Everyone, >> > > >> > > I recently pushed a change(pull request 20) to get the line ending >> from >> > the >> > > parser. >> > > >> > > Now I want to push another change which I feel will also be useful for >> > the >> > > community. I want to add a CSVRecordMutable class which had a >> constructor >> > > which accepts a CSVRecord object. So when we have a CSVRecordMutable >> > object >> > > from it then we can edit individual columns using it. >> > > >> > > I would be using this to write back my edited CSV file. My use case >> is to >> > > read a csv, mangle some columns, write back a new csv. >> > > >> > > I could have directly raised a pull request but I just wanted to float >> > the >> > > idea before and see the reaction. >> > > >> > > Thanks >> > > >> > > Nitin >> > > >> > >> > >
Re: [CSV] CSVMutableRecord
Hi, I very much like that CSVRecord is unmodifiable. So I’d suggest an API, that creates a new record instead of mutating the existing one: CSVRecord newRecord = myRecord.put(1, „value") I’m not sure about „put“ as a method name since it clashes with java.util.Map#put, which is mutation based... Regards, Benedikt > Am 15.08.2017 um 02:54 schrieb Gary Gregory : > > Feel free to provide a PR on GitHub :-) > > Gary > > On Aug 14, 2017 15:29, "Gary Gregory" wrote: > >> I think we've kept the design as YAGNI as possible... :-) >> >> Gary >> >> On Mon, Aug 14, 2017 at 3:25 PM, nitin mahendru < >> nitin.mahendr...@gmail.com> wrote: >> >>> Yeah that also is OK. I though there is a reason to keep the CSVRecord >>> without setters. But maybe not! >>> >>> Nitin >>> >>> >>> >>> >>> On Mon, Aug 14, 2017 at 2:22 PM Gary Gregory >>> wrote: >>> Hi All: Should we consider adding put(int,Object) and put(String, Object) to the current CSVRecord class? Gary On Mon, Aug 14, 2017 at 2:54 PM, nitin mahendru < nitin.mahendr...@gmail.com> wrote: > Hi Everyone, > > I recently pushed a change(pull request 20) to get the line ending >>> from the > parser. > > Now I want to push another change which I feel will also be useful for the > community. I want to add a CSVRecordMutable class which had a >>> constructor > which accepts a CSVRecord object. So when we have a CSVRecordMutable object > from it then we can edit individual columns using it. > > I would be using this to write back my edited CSV file. My use case >>> is to > read a csv, mangle some columns, write back a new csv. > > I could have directly raised a pull request but I just wanted to float the > idea before and see the reaction. > > Thanks > > Nitin > >>> >> >> - To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org