CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
Help me to modify perl 'excel to xml'

 



cibien
Novice

Jul 24, 2012, 3:49 PM

Post #1 of 2 (1994 views)
Help me to modify perl 'excel to xml' Can't Post

  
Hello everybody, I'am a new member and I need your help to modify a perl file named 'material mapping generator.pl'.


My file perl convert a excel table to material mapping .xml.

in the field "pr_family" the user can concatenate the family value in one cell like '1,2' , with 'foreach' and 'split' command every value generate a line in the xml file with the right family.

is possible to do the same for propriety?


In the perl the part of code to modify I think is near these comment: ( #for every family print a line) I have to do the same for (#set properties)

in attachment is the complete file perl

I'am beginner with perl, thanks for your help.

Thanks for a genius can help me


(This post was edited by cibien on Jul 24, 2012, 11:23 PM)
Attachments: materialmapping_generator.pl (12.1 KB)


cibien
Novice

Jul 25, 2012, 1:22 AM

Post #2 of 2 (1907 views)
Re: [cibien] Help me to modify perl 'excel to xml' [In reply to] Can't Post

example:

how is now:

excel
___________________________________
---------|pr_family|___pr1___|___pr2___|
___________________________________

item 1 |___1,2__|__value 1_|_value 2_|


item 2 |___1,2__|__value 3_|_value 3_|


item 3 |___1,2__|__value 5_|_value 4_|


convert to XML:

item 1 - pr_family: 1 - pr_1: value 1 - pr_2: value 2 -

item 1 - pr_family: 2 - pr_1: value 1 - pr_2: value 2 -

item 2 - pr_family: 1 - pr_1: value 3 - pr_2: value 3 -

item 2 - pr_family: 2 - pr_1: value 3 - pr_2: value 3 -

item 3 - pr_family: 1 - pr_1: value 5 - pr_2: value 4 -

item 3 - pr_family: 2 - pr_1: value 5 - pr_2: value 4 -
_________________________________________________________


how must be result, with split (',') in pr1,pr2:


excel
________________________________________________
---------|_pr_family_|____pr1________|____pr2________|
________________________________________________

item 1 |___1,2____|_value 1,value 5_|____value 2_____|

item 2 |___1,2____|_____value 3____|_value 3,value 4_|

item 3 |___1,2____|_____value 5____|____value 4_____|


convert to XML:

item 1 - pr_family: 1 - pr_1: value 1 - pr_2: value 2 -

item 1 - pr_family: 2 - pr_1: value 1 - pr_2: value 2 -

item 1 - pr_family: 1 - pr_1: value 5 - pr_2: value 2 -

item 1 - pr_family: 2 - pr_1: value 5 - pr_2: value 2 -

item 2 - pr_family: 1 - pr_1: value 3 - pr_2: value 3 -

item 2 - pr_family: 2 - pr_1: value 3 - pr_2: value 3 -

item 2 - pr_family: 1 - pr_1: value 3 - pr_2: value 4 -

item 2 - pr_family: 2 - pr_1: value 3 - pr_2: value 4 -

item 3 - pr_family: 1 - pr_1: value 5 - pr_2: value 4 -

item 3 - pr_family: 2 - pr_1: value 5 - pr_2: value 4 -
_________________________________________________________


(This post was edited by cibien on Jul 25, 2012, 1:47 AM)

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives