[solved]Modify a text file

massimopasquali
Member Posts: 82
hello guys,
I have to modify a text file (for example : pippo.xml).
I need to change a raw in the file
FROM
TestoFile2 := '<Prestazione xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:./xsd/A/A40_0050.xsd" cod_servizio="A40" cod_flusso="0050">'
To
<Prestazione FileRicevutoVendita="file:./xsd/A/A40_0050.xsd" cod_servizio="A40" cod_flusso="0050">
Actualy I have used the sentence below to replace the raw FROM -> TO
Pos := STRPOS(TestoFile2,'xmlns');
FileXml2.WRITE(PADSTR('FileRicevutoVendita="file:./xsd/A/A40_0050.xsd" cod_servizio="A40" cod_flusso="0050">', STRLEN(TestoFile2) - (Pos - 1)));
But don't Work, this is the result. :
'<Prestazione FileRicevutoVendita="file:./xsd/A/A40_0050.xsd" cod_servizio="A40" cod_flusso="0050"> '
I don't want the blank spaces after ">". The question is : IS A POSSIBLE TO REPLACE ALL RAW WITH A NAVISION'S KEYWORD?
I need to have this result :
<Prestazione FileRicevutoVendita="file:./xsd/A/A40_0050.xsd" cod_servizio="A40" cod_flusso="0050">
without blank spaces.
thanks
I have to modify a text file (for example : pippo.xml).
I need to change a raw in the file
FROM
TestoFile2 := '<Prestazione xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="file:./xsd/A/A40_0050.xsd" cod_servizio="A40" cod_flusso="0050">'
To
<Prestazione FileRicevutoVendita="file:./xsd/A/A40_0050.xsd" cod_servizio="A40" cod_flusso="0050">
Actualy I have used the sentence below to replace the raw FROM -> TO
Pos := STRPOS(TestoFile2,'xmlns');
FileXml2.WRITE(PADSTR('FileRicevutoVendita="file:./xsd/A/A40_0050.xsd" cod_servizio="A40" cod_flusso="0050">', STRLEN(TestoFile2) - (Pos - 1)));
But don't Work, this is the result. :
'<Prestazione FileRicevutoVendita="file:./xsd/A/A40_0050.xsd" cod_servizio="A40" cod_flusso="0050"> '
I don't want the blank spaces after ">". The question is : IS A POSSIBLE TO REPLACE ALL RAW WITH A NAVISION'S KEYWORD?
I need to have this result :
<Prestazione FileRicevutoVendita="file:./xsd/A/A40_0050.xsd" cod_servizio="A40" cod_flusso="0050">
without blank spaces.
thanks
0
Comments
-
I this is xml file, i would read it to XmlDom and then transform. At least you will be sure you producing valid XML.0
-
ok I try to use.0
-
can you post me an example?0
-
I haven't got an example on me, but if you google XMLDom - you'll find out.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions