0% found this document useful (0 votes)
2 views3 pages

XML Processing with ModifyNetXML Tool

The document provides instructions for using the ModifyNetXML program to process XML files. It explains that the program allows selecting an XML file and settings file, and will process the XML file according to the settings and output the results. It then describes how to format the settings file with pipe-delimited records specifying processing methods to apply to tags, such as replacing, removing, or inserting text. Various text processing methods are defined along with their syntax.

Uploaded by

TusharPatil
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

XML Processing with ModifyNetXML Tool

The document provides instructions for using the ModifyNetXML program to process XML files. It explains that the program allows selecting an XML file and settings file, and will process the XML file according to the settings and output the results. It then describes how to format the settings file with pipe-delimited records specifying processing methods to apply to tags, such as replacing, removing, or inserting text. Various text processing methods are defined along with their syntax.

Uploaded by

TusharPatil
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Open ModifyNetXML program.

Input, Settings and Output Text Boxes are non-editable. Use buttons next to them to set values.

Select File – Select Xml file to be processed from Local Drive

Select Folder – Select Folder containing xml files to be processed from Local Drive

Settings – Select File which contains settings which will be used for processing text inside XML file.

Context – Enter Context as used in XML file or for Project.

Select Output Folder– Select Folder to which output of processed xml files to be saved.

Process XML – Processes input xml file(s) with settings provided and saves output to output folder.

Log Window – Details of Tags Processed and same will be saved to Log File in Output Folder.
How to Prepare Settings File

Create Any Text file in Local Drive. Content of Settings file shall be as shown below

This File is Pipe (|) Delimited.

e.g. Instrument_01|Instrument|Rephowmanyoccurences, ,,2;Insertatindex,-,2,4;

In Record, First is Dummy ClassID ,here “Instrument_01”, assigned in DIG. All tags having this dummy
tag id will processed as per requirement.

Second is Actual ClassID for Dummy ClassID. After processing Dummy ClassID will be replaced with
Actual ClassID in Output File.

Third is set Methods which will be applied on Tags to produce desired tag output.

Methods for Processing Tags

All methods are provided one after other separated by semi colon (;) and Arguments to methods are
separated by comma (,).

1. Repall [ Syntax : Repall,old_string ,new_string;]


This Methods replaces all occurrences of old_string by new_string.
Repall, ,*;  This Syntax replaces all spaces with star (*).
e.g. PT 1225 using above method gives PT*1225

2. Remall [ Syntax : Remall,old_string;]


This Methods Removes all occurrences of old_string.
Remall,-;  This Syntax removes all – (dash) characters from string.
e.g. PT-123-45_6 using above method gives PT12345_6

3. Rephowmanyoccurences [ Syntax : Rephowmanyoccurences,old_string,new_string,count]


This Method Replaces given number [as specified by count] of old_string by new_string from given
string.
Rephowmanyoccurences,-,_,2;  This Syntax replaces first two occurrences of – (dash) with _
(underscore) while remaining occurrences will be unaffected.
e.g. PT-123-4-6 using above method gives PT_123_4-6

4. Insertatindex [ Syntax : Insertatindex,old_string,index1,index2,…]


This Method Inserts Old String at index positions at index1, index2, index3 and so on.
Insertatindex,-,3,5,7 This Syntax Inserts – at Index Position 2 and 4 in Given Tag.
e.g. PT123456 using above method gives PT-12-34-56
Note : Specifying Index position outside length of String results in Error exception.

Note : Output of One method is Input to Next method being called. So all methods must used in
correct sequence to get desired output otherwise you may get wrong tags in Output Files.
So its better to Test methods before bulk processing xml files.

e.g. Tag 11_VT 9999 could be Equipment tag which should have been 11-VT-9999. So in order to get
desired Tag 11-VT-9999, it needs to be processed using following methods.

Input : 11_VT 9999 with method Repall, ,-; gives Output : 11_VT-9999

Input : 11_VT-9999 with method Repall,_,-; gives Output : 11-VT-9999

So in settings files, it should be

Equip_01|Equipment|Repall, ,-;Repall,_,-;

You might also like