in reply to Re: How to substitute a word with an other?
in thread How to substitute a word with an other?

Hi and thanks for your answer, I will try to be more effectively in my question! ;-) I have a file (File.txt in my code) with many lines like this one:

<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Header/><SOAP-ENV:Body><ServerName>RIGHTb4024</ServerName><DateTime>2013-04-22 10:53:22</DateTime><Application>SFMWW</Application><Function>Query</Function><UserNameOS>TESTER001</UserNameOS><UserNameApp>TESTER001</UserNameApp><LocationIP>17 2.31.8.71</LocationIP><LocationMachineName>RIGHTb4024</LocationMachineName><LocationMachineType/><LocationSessionID/><LocationRemoteIP/><LocationRemoteMachineName/><Lo cationRemoteUserName</LocationRemoteUserName><Customer>123456789016</Customer><Product>001007</Product><Operation>DET</Operation></SOAP-ENV:Body></SOAP-ENV:En velope>

And what I need is to have an output file (Output.txt in my code) with a specific field value changed the like this

<UserNameApp>TESTER001</UserNameApp>

with

<UserNameApp>Frank.Sinatra</UserNameApp>.

Following a specific association in file Address.txt :

TESTER001,Frank.Sinatra

TESTER002,Cyndy.Crawford

and so on .. Thanks for your help.

  • Comment on Re^2: How to substitute a word with an other?

Replies are listed 'Best First'.
Re^3: How to substitute a word with an other?
by Anonymous Monk on May 16, 2014 at 15:42 UTC

    Perhaps XML::Rules and its filter* methods would work for you?

    PerlMonks isn't a code writing service, but if you post the code you're having problems with, we'll be happy to help.