Our Brands

Impact-Company-Logo-English Black-01-177x54

Welcome to the Schneider Electric Website

Welcome to our website.
		
How can we help you today?
Batch Script to Remove Comma from XML saved Report for VIP XML import Module
Issue
User wants to use saved XML file from a report to use in the VIP however the format of the XML includes numbers with at least one comma that prevents the XML importer from reading the data.

Product
PME 7.2.x, 8.x, 9.x

Environment
Designer

Cause
In PME, web report XML saved subscriptions started to include the comma to separate numbers for readability (eg 1,234.56). The XML import module views the result as a string rather than a number.

Resolution

Option 1
Create a batch file that executes the following script to save the XML to a new file without the comma. Replace the test.txt (original XML file) and testnew.txt (new XML file) to match the names used in your system.

::-------begin code---------
@echo off
for /f "delims=" %%a in (test.txt) do call :process "%%a"
goto :eof

:process
set strData=%1
set strData=%strData:,=%
for /f "delims=" %%x in (%strData%) do echo %%x >> testnew.txt
::-------end code-----------


Option 2
Use a Find and Replace tool such as FNR.exe (attached to this KB) to replace the commas.
Command such as:
FNR.exe --cl --dir "Full Path Of XML File" --fileMask "Name of XML file" --excludeFileMask "*.dll, *.exe" --useRegEx --find "," --replace ""
Where "Full path of XML" is location where XML file is saved such as "C:\saved XML\My folder" and
"Name of XML file" is the name of the XML file to process such as "My XMLfile.xml"

Schneider Electric Egypt and North East Africa

Attachment(s)
fnr.zip [68.02 KB]
Explore more
Range:
Users group

Discuss this topic with experts

Visit our community and get advice from experts and peers on this topic and more
Explore more
Range:

Need help?

  • Start here!

    Find answers now. Search for a solution on your own, or connect with one of our experts.

  • Contact Support

    Reach out to our customer care team to receive more information, technical support, assistance with complaints and more.

  • Where to buy?

    Easily find the nearest Schneider Electric distributor in your location.

  • Search FAQs

    Search topic-related frequently asked questions to find answers you need.

  • Contact Sales

    Start your sales inquiry online and an expert will connect with you.

I'd like to receive news and commercial info from Schneider Electric and its affiliates via electronic communication means such as email, and I agree to the collection of information on the opening and clicks on these emails (using invisible pixels in the images), to measure performance of our communications and improve them. For more details, please read our Privacy Policy.

  • Products Documentation
  • Software Downloads
  • Product Selector
  • Product Substitution and Replacement
  • Help and Contact Center
  • Find our Offices
  • Get a Quote
  • Where to buy
  • Careers
  • Company Profile
  • Report a misconduct
  • Accessibility
  • Newsroom
  • Investors
  • EcoStruxure
  • Job Search
  • Blog
  • Privacy Policy
  • Cookie Notice
  • Terms of use
  • Change your cookie settings