Re: [go-nuts] How to have fixed xml attributes "Header"

2019-12-12 Thread paresh patil
Thanks a lot Marcin, it worked

The code is working as expected and I can generate the xml file from csv.

Now my next challenges are:

   1. How to have fixed values in the xml file,

**
* 3.4*
* *
* 1*
* 2019-11-04 18:11 - Is there a
way in Go to returns current time stamp? so we get the date and time of
when the xml file is created?*
* GMT*
* MANIFEST-0007-04112019.XML - Is there a way to pre
define this name, so every time the file is created it should have the file
name as MANIFEST-0007-Todays Dates.XML*
* *


   1. How to make this code an applications, so it can be used on multiple
   computes (which do not have Go installed)? Can I convert the file into .exe?

In that case, how to put a generic path for reading the csv file and saving
the xml output file?

https://play.golang.org/p/blTJHPHt4Ms



On Thu, Dec 12, 2019 at 6:39 PM Marcin Romaszewicz 
wrote:

> Your code creates an array for manifests ([]Manifest), and puts one entry
> in there for each package, so encoding/xml is dutifully doing what you
> asked it to do :)
>
> You need to change your object structure so that you have one manifest
> with a single header, and a list of packages.
>
> Something like this:
> https://play.golang.org/p/erzmyjt3Xwf
>
>
>
> On Thu, Dec 12, 2019 at 10:18 AM paresh patil 
> wrote:
>
>> Hi Marcin,
>>
>> Thanks for writing back I will sure try your code
>>
>> I'm attaching the zip folder which has the complete code. It needs some
>> corrections as well,
>>
>> Let me know your thoughts
>>
>> Thanks
>>
>> On Thu, Dec 12, 2019 at 6:14 PM Marcin Romaszewicz 
>> wrote:
>>
>>> Could you share your code which isn't working?
>>>
>>> Here's a simple example of how you would do something like that, but not
>>> knowing your code, it might not be helpful.
>>> https://play.golang.org/p/H-9eCTYJxTA
>>>
>>>
>>> On Thu, Dec 12, 2019 at 9:57 AM paresh patil 
>>> wrote:
>>>
 Hi,


 I'm new to Go and finding it interesting to learn. I'm not a developer
 or programmer, but I have interest in learning to code

 I'm working on a project to convert csv file to xml file. The code
 executes and I'm able to generate a xml file. But the file is not in the
 expected format. I seek some help

 I'm expecting the below results in xml output:


 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


 However what I get is as below:


 

 

 

 

 

 

 

 

 

 

 
 

 

 

 

 

 

 

 

 

 

 


 Please help

 --
 You received this message because you are subscribed to the Google
 Groups "golang-nuts" group.
 To unsubscribe from this group and stop receiving emails from it, send
 an email to golang-nuts+unsubscr...@googlegroups.com.
 To view this discussion on the web visit
 https://groups.google.com/d/msgid/golang-nuts/085e7f7b-105e-48f1-9e09-55f0b5e40136%40googlegroups.com
 
 .

>>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAKpQEPkeMVzVB1Q-P0M%2B-HB4%3DA0p102h8G%2B2_ygdUze6jCyU%2Bg%40mail.gmail.com.


Re: [go-nuts] How to have fixed xml attributes "Header"

2019-12-12 Thread Marcin Romaszewicz
Your code creates an array for manifests ([]Manifest), and puts one entry
in there for each package, so encoding/xml is dutifully doing what you
asked it to do :)

You need to change your object structure so that you have one manifest with
a single header, and a list of packages.

Something like this:
https://play.golang.org/p/erzmyjt3Xwf



On Thu, Dec 12, 2019 at 10:18 AM paresh patil 
wrote:

> Hi Marcin,
>
> Thanks for writing back I will sure try your code
>
> I'm attaching the zip folder which has the complete code. It needs some
> corrections as well,
>
> Let me know your thoughts
>
> Thanks
>
> On Thu, Dec 12, 2019 at 6:14 PM Marcin Romaszewicz 
> wrote:
>
>> Could you share your code which isn't working?
>>
>> Here's a simple example of how you would do something like that, but not
>> knowing your code, it might not be helpful.
>> https://play.golang.org/p/H-9eCTYJxTA
>>
>>
>> On Thu, Dec 12, 2019 at 9:57 AM paresh patil 
>> wrote:
>>
>>> Hi,
>>>
>>>
>>> I'm new to Go and finding it interesting to learn. I'm not a developer
>>> or programmer, but I have interest in learning to code
>>>
>>> I'm working on a project to convert csv file to xml file. The code
>>> executes and I'm able to generate a xml file. But the file is not in the
>>> expected format. I seek some help
>>>
>>> I'm expecting the below results in xml output:
>>>
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>>
>>> However what I get is as below:
>>>
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>> 
>>>
>>>
>>> Please help
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "golang-nuts" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to golang-nuts+unsubscr...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/golang-nuts/085e7f7b-105e-48f1-9e09-55f0b5e40136%40googlegroups.com
>>> 
>>> .
>>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bv29LuuPNCts5kDLgKtpCV%2B76rn7FphdWdJTZN%3D_bHWMV%3DFGw%40mail.gmail.com.


Re: [go-nuts] How to have fixed xml attributes "Header"

2019-12-12 Thread paresh patil
Hi Marcin,

Thanks for writing back I will sure try your code

I'm attaching the zip folder which has the complete code. It needs some
corrections as well,

Let me know your thoughts

Thanks

On Thu, Dec 12, 2019 at 6:14 PM Marcin Romaszewicz 
wrote:

> Could you share your code which isn't working?
>
> Here's a simple example of how you would do something like that, but not
> knowing your code, it might not be helpful.
> https://play.golang.org/p/H-9eCTYJxTA
>
>
> On Thu, Dec 12, 2019 at 9:57 AM paresh patil 
> wrote:
>
>> Hi,
>>
>>
>> I'm new to Go and finding it interesting to learn. I'm not a developer or
>> programmer, but I have interest in learning to code
>>
>> I'm working on a project to convert csv file to xml file. The code
>> executes and I'm able to generate a xml file. But the file is not in the
>> expected format. I seek some help
>>
>> I'm expecting the below results in xml output:
>>
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>>
>> However what I get is as below:
>>
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>> 
>>
>>
>> Please help
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "golang-nuts" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to golang-nuts+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/golang-nuts/085e7f7b-105e-48f1-9e09-55f0b5e40136%40googlegroups.com
>> 
>> .
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAKpQEPnxT%3DKawFNt0A6dDX1-k5Oe26H5AcDbNND_UC9y%2BgzcSA%40mail.gmail.com.
<>


Re: [go-nuts] How to have fixed xml attributes "Header"

2019-12-12 Thread Marcin Romaszewicz
Could you share your code which isn't working?

Here's a simple example of how you would do something like that, but not
knowing your code, it might not be helpful.
https://play.golang.org/p/H-9eCTYJxTA


On Thu, Dec 12, 2019 at 9:57 AM paresh patil 
wrote:

> Hi,
>
>
> I'm new to Go and finding it interesting to learn. I'm not a developer or
> programmer, but I have interest in learning to code
>
> I'm working on a project to convert csv file to xml file. The code
> executes and I'm able to generate a xml file. But the file is not in the
> expected format. I seek some help
>
> I'm expecting the below results in xml output:
>
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
> However what I get is as below:
>
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
> 
>
>
> Please help
>
> --
> You received this message because you are subscribed to the Google Groups
> "golang-nuts" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/085e7f7b-105e-48f1-9e09-55f0b5e40136%40googlegroups.com
> 
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CA%2Bv29LtaTQPSVPh5fHVaQKWObgPYFw%2Bdjii7yDiK4prL5ou%3D5A%40mail.gmail.com.


[go-nuts] How to have fixed xml attributes "Header"

2019-12-12 Thread paresh patil


Hi,


I'm new to Go and finding it interesting to learn. I'm not a developer or 
programmer, but I have interest in learning to code

I'm working on a project to convert csv file to xml file. The code executes 
and I'm able to generate a xml file. But the file is not in the expected 
format. I seek some help

I'm expecting the below results in xml output:



































However what I get is as below:














































Please help

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/085e7f7b-105e-48f1-9e09-55f0b5e40136%40googlegroups.com.