Re: yaml file conversion

2011-03-05 Thread Rob Dixon
On 04/03/2011 01:00, Jim Green wrote: Thanks Jim, this will definitely work. but changing order of keys is a general problems and hopefull some module exists to do that. I think you are overestimating the generality of this problem. I cannot remember seeing it before, apart from a simple rever

Re: yaml file conversion

2011-03-04 Thread Uri Guttman
> "JG" == Jim Green writes: JG> Thanks Brandon, YAML should get some functions to manipulate it.. that doesn't make sense. yaml and other serializers don't manipulate data. they convert in memory data to a string format that can be saved, printed, send on a socket, transfered between langu

Re: yaml file conversion

2011-03-04 Thread Uri Guttman
> "JG" == Jim Green writes: JG> On Thu, Mar 3, 2011 at 6:31 PM, Jim Gibson wrote: >> On 3/3/11 Thu  Mar 3, 2011  3:11 PM, "Jim Green" >> scribbled: >> >>> On Mar 3, 5:44 pm, shawnhco...@gmail.com (Shawn H Corey) wrote: On 11-03-03 05:40 PM, Jim Green wrote: >

Re: yaml file conversion

2011-03-04 Thread Jim Green
Thanks Brandon, YAML should get some functions to manipulate it.. On Thu, Mar 3, 2011 at 7:56 PM, Brandon McCaig wrote: > On Thu, Mar 3, 2011 at 6:39 PM, Brandon McCaig wrote: >> I don't know if I'd call it easier. I'm not personally familiar with >> YAML so I only bothered to parse the example

Re: yaml file conversion

2011-03-04 Thread Jim Green
On Thu, Mar 3, 2011 at 6:31 PM, Jim Gibson wrote: > On 3/3/11 Thu  Mar 3, 2011  3:11 PM, "Jim Green" > scribbled: > >> On Mar 3, 5:44 pm, shawnhco...@gmail.com (Shawn H Corey) wrote: >>> On 11-03-03 05:40 PM, Jim Green wrote: >>> But is there a easier way of doing this I might not be aw

Re: yaml file conversion

2011-03-04 Thread Rob Dixon
On 03/03/2011 22:40, Jim Green wrote: Hello: I have a yaml file key1: a: value1 b: value1 key2: a: value2 b: value2 I want it converted to a: key1:value1 key2:value2 b: key1:value1 key2:value2 I could use YAML module to load the first yaml file to a hash and ma

Re: yaml file conversion

2011-03-03 Thread Brandon McCaig
On Thu, Mar 3, 2011 at 6:39 PM, Brandon McCaig wrote: > I don't know if I'd call it easier. I'm not personally familiar with > YAML so I only bothered to parse the example that you gave. Actually looking into YAML it seems much more complicated than this so unless you know for sure that the input

Re: yaml file conversion

2011-03-03 Thread Brandon McCaig
On Thu, Mar 3, 2011 at 5:40 PM, Jim Green wrote: > manually populate another hash and dump. But is there a easier way of > doing this I might not be aware of? I don't know if I'd call it easier. I'm not personally familiar with YAML so I only bothered to parse the example that you gave. #!/usr/b

Re: yaml file conversion

2011-03-03 Thread Jim Gibson
On 3/3/11 Thu Mar 3, 2011 3:11 PM, "Jim Green" scribbled: > On Mar 3, 5:44 pm, shawnhco...@gmail.com (Shawn H Corey) wrote: >> On 11-03-03 05:40 PM, Jim Green wrote: >> >>> But is there a easier way of >>> doing this I might not be aware of? >> >> Given your brief description, no.  The proble

Re: yaml file conversion

2011-03-03 Thread Jim Green
On Mar 3, 5:44 pm, shawnhco...@gmail.com (Shawn H Corey) wrote: > On 11-03-03 05:40 PM, Jim Green wrote: > > > But is there a easier way of > > doing this I might not be aware of? > > Given your brief description, no.  The problem is that you can't output > the first datum without reading the last,

Re: yaml file conversion

2011-03-03 Thread Shawn H Corey
On 11-03-03 05:40 PM, Jim Green wrote: But is there a easier way of doing this I might not be aware of? Given your brief description, no. The problem is that you can't output the first datum without reading the last, because the last may be the first thing that needs to be outputted. -- J

yaml file conversion

2011-03-03 Thread Jim Green
Hello: I have a yaml file key1: a: value1 b: value1 key2: a: value2 b: value2 I want it converted to a: key1:value1 key2:value2 b: key1:value1 key2:value2 I could use YAML module to load the first yaml file to a hash and manually populate another hash and dump. But is th