0

I have an .xml document.

<Record>
        <tag1>1</tag1>
        <tag2>...</tag2>
        ...
        <tagN>...</tagN>
</Record>
...
<Record>
        <tag1>100</tag1>
        <tag2>...</tag2>
        ...
        <tagN>...</tagN>
</Record>

All I need is to divide a data by 1000 in tags <tagN> and then to round it with precision of 2. For example, <tagN>123456</tagN> becomes <tagN>123.46</tagN>. Is there any possibility to do it in IntelliJ Idea using Replace ?

andrew
  • 3
  • 2
  • 1
    I don't think it is possible. You could do regex matching to replace the numbers but you can't perform any math on them. There are some suggestions here. http://stackoverflow.com/a/5245422/2377639 – Will Humphreys Jul 01 '16 at 14:09

1 Answers1

0

If you're trying to do math and rounding on your document, even the sophisticated structural search and replace that IntelliJ IDEA has probably isn't enough. If I needed to do this for a large document or set of documents, I'd probably write an XSLT transform for it, or a quick one-off program in some other language.