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
Power Monitoring Expert 7.2
Power Monitoring Expert 8.x
Power Monitoring Expert 9.x
Power Monitoring Expert 2021
Power Monitoring Expert 2022
Power Monitoring Expert 2023
Power Monitoring Expert 2024
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 files 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"
게시 대상: 슈나이더 일렉트릭 Korea


도움이 필요하신가요?
제품 선택기
애플리케이션에 적합한 제품과 액세서리를 빠르고 쉽게 찾을 수 있습니다.
견적 받기
영업 관련하여 온라인으로 문의하시면 전문가가 연락드립니다.
구매처
해당 지역의 가장 가까운 슈나이더 일렉트릭 대리점을 쉽게 찾을 수 있습니다.
지원 센터
한 곳에서 모든 요구 사항에 대한 지원 리소스를 찾아보십시오.