Page 2 of 3 < 1 2 3 >
Topic Options
#38993 - 03/28/12 02:32 PM Re: how to remove line # x to line # z [Re: stuartg]
sygui Offline
OL Guru

Registered: 11/02/10
Posts: 108
I'll try this one. thks

Top
#38995 - 03/28/12 02:36 PM Re: how to remove line # x to line # z [Re: stuartg]
sygui Offline
OL Guru

Registered: 11/02/10
Posts: 108
yes but I can I make sure the first block is not remove ? I need to remove all of them except the first block

Top
#38999 - 03/29/12 06:44 AM Re: how to remove line # x to line # z [Re: sygui]
stuartg Offline
OL Expert

Registered: 03/06/03
Posts: 635
Loc: Swindon, England
The obvious way to do this is to have several search/replace tasks.

The first search finds the 1st occurence of <Line> and changes it to something else. Search for <Line>, replace by <LLLine>, search whole file, not a regular expression, Position = occurrence number 1.

The second search you already have.

The third switches that 1st occurence back again. Search for <LLLine>, replace by <Line>.

Hope that helps.

Top
#39016 - 03/29/12 03:36 PM Re: how to remove line # x to line # z [Re: stuartg]
sygui Offline
OL Guru

Registered: 11/02/10
Posts: 108
I've tried it but it did remove everything....not only CustomNumeric1>0....

is this really ok ?<Line>[\s\S]*<CustomNumeric1>0[\s\S]*</Line>\r\n

Top
#39020 - 03/30/12 04:48 AM Re: how to remove line # x to line # z [Re: sygui]
stuartg Offline
OL Expert

Registered: 03/06/03
Posts: 635
Loc: Swindon, England
I tried it and it works for me, so I will try and explain it again.

You need several advanced search and replace tasks in your config. The first one -



followed by -



and then -



When you type in your search strings, make sure that there are no trailing spaces. If you cut and paste from this page, you might get a space added to the end, which you need to remove.

Hope this helps.

Top
#39056 - 04/02/12 09:11 AM Re: how to remove line # x to line # z [Re: stuartg]
sygui Offline
OL Guru

Registered: 11/02/10
Posts: 108
Here is my file. the first occurence works great. but the <Line>[\s\S]*<CustomNumeric1>0[\s\S]*</Line>\r\n removes all lines between <Line> and </Line> even if <CustomNumeric1> is not 0.


<?xml version="1.0" encoding="ISO-8859-1"?>
<Transactions>
<TmsShipOrder>
<SiteCode>16</SiteCode>
<OrderNumber>16087094-00</OrderNumber>
<ConsigneeNum>12164</ConsigneeNum>
<ConsigneeName>TIRE DISCOUNTER GROUP INC</ConsigneeName>
<ConsigneeAddress1>95 JOHN STREET</ConsigneeAddress1>
<ConsigneeAddress2>_</ConsigneeAddress2>
<ConsigneeCity>ORANGEVILLE</ConsigneeCity>
<ConsigneeStateProvCode>ON</ConsigneeStateProvCode>
<ConsigneeZipPostal>L9W 2R1</ConsigneeZipPostal>
<ConsigneeCountryCode>CA</ConsigneeCountryCode>
<HostServiceCode>DHL</HostServiceCode>
<Weight>2967.68</Weight>
<CustomChar1>SM147</CustomChar1>
<CustomChar2>TIRE DISCOUNTER GROUP INC</CustomChar2>
<Customchar3>DHL PREPAID</Customchar3>
<CustomChar4>1</CustomChar4>
<CustomChar5>MIDLAND TAILGATE</CustomChar5>
<CustomChar6></CustomChar6>
<CustomChar7></CustomChar7>
<CustomChar15>TAILGATE</CustomChar15>
<CustomNumeric1>3403</CustomNumeric1>
<TmsShipOrderDetail>
<Line>
<Quantity>-4</Quantity>
<ItemNumber>X40794</ItemNumber>
<ProductDescription>MERC 16X71/2 5-112</ProductDescription>
<UnitWeight>23</UnitWeight>
<CustomChar1>(SKID 25)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 123</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>92</CustomNumeric2>
</Line>
<Line>
<Quantity>-10</Quantity>
<ItemNumber>x42655</ItemNumber>
<ProductDescription>MULTI 16X61/2 5-41/2</ProductDescription>
<UnitWeight>23</UnitWeight>
<CustomChar1>(SKID 30)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 001</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>230</CustomNumeric2>
</Line>
<Line>
<Quantity>-5</Quantity>
<ItemNumber>X41657</ItemNumber>
<ProductDescription>MULTI 16X61/2 5-100</ProductDescription>
<UnitWeight>23</UnitWeight>
<CustomChar1>(SKID 30)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 015</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>115</CustomNumeric2>
</Line>
<Line>
<Quantity>-3</Quantity>
<ItemNumber>X40878</ItemNumber>
<ProductDescription>HONDA 16X61/2 5-41/2</ProductDescription>
<UnitWeight>21</UnitWeight>
<CustomChar1>(SKID 30)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 028</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>63</CustomNumeric2>
</Line>
<Line>
<Quantity>-2</Quantity>
<ItemNumber>x43657</ItemNumber>
<ProductDescription>GM 16X61/2 5-105</ProductDescription>
<UnitWeight>18</UnitWeight>
<CustomChar1>(SKID 30)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 102</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>36</CustomNumeric2>
</Line>
<Line>
<Quantity>-2</Quantity>
<ItemNumber>X40876T</ItemNumber>
<ProductDescription>TOY 16X61/2 5-100</ProductDescription>
<UnitWeight>21</UnitWeight>
<CustomChar1>(SKID 30)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 030</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>42</CustomNumeric2>
</Line>
<Line>
<Quantity>-4</Quantity>
<ItemNumber>X42554</ItemNumber>
<ProductDescription>MULTI 15X6 5-41/2</ProductDescription>
<UnitWeight>20</UnitWeight>
<CustomChar1>(SKID 48)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 014</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>80</CustomNumeric2>
</Line>
<Line>
<Quantity>-1</Quantity>
<ItemNumber>X40861</ItemNumber>
<ProductDescription>HONDA 15X6 4-100</ProductDescription>
<UnitWeight>22</UnitWeight>
<CustomChar1>(SKID 48)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 060</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>22</CustomNumeric2>
</Line>
<Line>
<Quantity>-1</Quantity>
<ItemNumber>x41546</ItemNumber>
<ProductDescription>MULTI 15X6 4-41/4</ProductDescription>
<UnitWeight>22</UnitWeight>
<CustomChar1>(SKID 48)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 026</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>22</CustomNumeric2>
</Line>
<Line>
<Quantity>-1</Quantity>
<ItemNumber>X42553</ItemNumber>
<ProductDescription>MULTI 15X61/2 5-110</ProductDescription>
<UnitWeight>19</UnitWeight>
<CustomChar1>(SKID 40)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 033</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>19</CustomNumeric2>
</Line>
<Line>
<Quantity>-19</Quantity>
<ItemNumber>x42755</ItemNumber>
<ProductDescription>MULTI 17X61/2 5-41/2</ProductDescription>
<UnitWeight>25</UnitWeight>
<CustomChar1>(SKID 30)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 004</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>475</CustomNumeric2>
</Line>
<Line>
<Quantity>-1</Quantity>
<ItemNumber>X42757T</ItemNumber>
<ProductDescription>DODGE 17X61/2 5-41/2</ProductDescription>
<UnitWeight>25</UnitWeight>
<CustomChar1>(SKID 30)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 088</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>25</CustomNumeric2>
</Line>
<Line>
<Quantity>-1</Quantity>
<ItemNumber>X42768</ItemNumber>
<ProductDescription>MULTI 17X7 6-51/2</ProductDescription>
<UnitWeight>30</UnitWeight>
<CustomChar1>(SKID 25)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 027</CustomChar3>
<CustomNumeric1>1</CustomNumeric1>
<CustomNumeric2>30</CustomNumeric2>
</Line>
<Line>
<Quantity>-2</Quantity>
<ItemNumber>X42753</ItemNumber>
<ProductDescription>GM 17X61/2 5-110</ProductDescription>
<UnitWeight>25</UnitWeight>
<CustomChar1>(SKID 30)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 120</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>50</CustomNumeric2>
</Line>
<Line>
<Quantity>-1</Quantity>
<ItemNumber>X44754</ItemNumber>
<ProductDescription>MULTI 17X61/2 5-120</ProductDescription>
<UnitWeight>23</UnitWeight>
<CustomChar1>(SKID 30)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 141</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>23</CustomNumeric2>
</Line>
<Line>
<Quantity>-2</Quantity>
<ItemNumber>X41752</ItemNumber>
<ProductDescription>DODGE 17X7 5-51/2</ProductDescription>
<UnitWeight>32</UnitWeight>
<CustomChar1>(SKID 25)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 023</CustomChar3>
<CustomNumeric1>1</CustomNumeric1>
<CustomNumeric2>64</CustomNumeric2>
</Line>
<Line>
<Quantity>-4</Quantity>
<ItemNumber>X41442</ItemNumber>
<ProductDescription>MULTI 14X51/2 4-100</ProductDescription>
<UnitWeight>20</UnitWeight>
<CustomChar1>(SKID 48)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 010</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>80</CustomNumeric2>
</Line>
<Line>
<Quantity>-1</Quantity>
<ItemNumber>X41340</ItemNumber>
<ProductDescription>MULTI 13X5 4-100</ProductDescription>
<UnitWeight>14</UnitWeight>
<CustomChar1>(SKID 56)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 232</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>14</CustomNumeric2>
</Line>
<Line>
<Quantity>-1</Quantity>
<ItemNumber>X40856</ItemNumber>
<ProductDescription>BMW 17X7 5-120</ProductDescription>
<UnitWeight>23</UnitWeight>
<CustomChar1>(SKID 20)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 127</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>23</CustomNumeric2>
</Line>
<Line>
<Quantity>-1</Quantity>
<ItemNumber>X41761</ItemNumber>
<ProductDescription>MULTI 17X61/2 6-115</ProductDescription>
<UnitWeight>28</UnitWeight>
<CustomChar1>(SKID 30)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 013</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>28</CustomNumeric2>
</Line>
<Line>
<Quantity>-4</Quantity>
<ItemNumber>X42652</ItemNumber>
<ProductDescription>HYUNDAI 16X61/2 5-41/2</ProductDescription>
<UnitWeight>23</UnitWeight>
<CustomChar1>(SKID 30)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 038</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>92</CustomNumeric2>
</Line>
<Line>
<Quantity>-1</Quantity>
<ItemNumber>X40825</ItemNumber>
<ProductDescription>GM 16X71/2 5-43/4</ProductDescription>
<UnitWeight>22</UnitWeight>
<CustomChar1>(SKID 30)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 401</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>22</CustomNumeric2>
</Line>
<Line>
<Quantity>-4</Quantity>
<ItemNumber>X41545</ItemNumber>
<ProductDescription>MULTI 15X6 4-41/2</ProductDescription>
<UnitWeight>22</UnitWeight>
<CustomChar1>(SKID 48)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 005</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>88</CustomNumeric2>
</Line>
<Line>
<Quantity>-5</Quantity>
<ItemNumber>X41753</ItemNumber>
<ProductDescription>MULTI 17X7 5-5</ProductDescription>
<UnitWeight>35</UnitWeight>
<CustomChar1>(SKID 25)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 020</CustomChar3>
<CustomNumeric1>1</CustomNumeric1>
<CustomNumeric2>175</CustomNumeric2>
</Line>
<Line>
<Quantity>-1</Quantity>
<ItemNumber>32117SHD</ItemNumber>
<ProductDescription>(4) WHEEL COVERS 17""</ProductDescription>
<UnitWeight>7</UnitWeight>
<CustomChar1>(SKID 48)</CustomChar1>
<CustomChar2>011</CustomChar2>
<CustomChar3>0000000011</CustomChar3>
<CustomNumeric1>1</CustomNumeric1>
<CustomNumeric2>7</CustomNumeric2>
</Line>
<Line>
<Quantity>-1</Quantity>
<ItemNumber>X41763</ItemNumber>
<ProductDescription>GM 17X7 6-132</ProductDescription>
<UnitWeight>25</UnitWeight>
<CustomChar1>(SKID 25)ETA APRIL 1</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 054</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>25</CustomNumeric2>
</Line>
<Line>
<Quantity>-10</Quantity>
<ItemNumber>X42751</ItemNumber>
<ProductDescription>TOYOTA 17X61/2 5-41/2</ProductDescription>
<UnitWeight>25</UnitWeight>
<CustomChar1>(SKID 30)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 068</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>250</CustomNumeric2>
</Line>
<Line>
<Quantity>-1</Quantity>
<ItemNumber>X44659</ItemNumber>
<ProductDescription>VOLKS 16X61/2 5-112</ProductDescription>
<UnitWeight>19</UnitWeight>
<CustomChar1>(SKID 30)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 011</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>19</CustomNumeric2>
</Line>
<Line>
<Quantity>-4</Quantity>
<ItemNumber>X43659</ItemNumber>
<ProductDescription>MULTI 16X7 5-112</ProductDescription>
<UnitWeight>23</UnitWeight>
<CustomChar1>(SKID 25)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 044</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>92</CustomNumeric2>
</Line>
<Line>
<Quantity>-4</Quantity>
<ItemNumber>X41557</ItemNumber>
<ProductDescription>MULTI 15X6 5-100</ProductDescription>
<UnitWeight>22</UnitWeight>
<CustomChar1>(SKID 48)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>16 024</CustomChar3>
<CustomNumeric1>2</CustomNumeric1>
<CustomNumeric2>88</CustomNumeric2>
</Line>
<Line>
<Quantity>-1</Quantity>
<ItemNumber>32116SHD</ItemNumber>
<ProductDescription>(4) WHEEL COVERS 16""</ProductDescription>
<UnitWeight>7</UnitWeight>
<CustomChar1>(SKID 48)</CustomChar1>
<CustomChar2>011</CustomChar2>
<CustomChar3>0000000011</CustomChar3>
<CustomNumeric1>1</CustomNumeric1>
<CustomNumeric2>7</CustomNumeric2>
</Line>
<Line>
<Quantity>-1</Quantity>
<ItemNumber>85415S</ItemNumber>
<ProductDescription>(4) WHEEL COVERS 15""</ProductDescription>
<UnitWeight>5</UnitWeight>
<CustomChar1>(SKID 48)</CustomChar1>
<CustomChar2>011</CustomChar2>
<CustomChar3>0000000011</CustomChar3>
<CustomNumeric1>1</CustomNumeric1>
<CustomNumeric2>5</CustomNumeric2>
</Line>
<Line>
<Quantity>-652</Quantity>
<ItemNumber>NBM12S19</ItemNumber>
<ProductDescription>NUT M12X1.25 X 19MM</ProductDescription>
<UnitWeight>.09</UnitWeight>
<CustomChar1>(PACK 100)</CustomChar1>
<CustomChar2>035</CustomChar2>
<CustomChar3>16 702</CustomChar3>
<CustomNumeric1>0</CustomNumeric1>
<CustomNumeric2>58.68</CustomNumeric2>
</Line>
<Line>
<Quantity>-400</Quantity>
<ItemNumber>NB050075</ItemNumber>
<ProductDescription>NUT 1/2 X 3/4</ProductDescription>
<UnitWeight>.04</UnitWeight>
<CustomChar1>(PACK 100)</CustomChar1>
<CustomChar2>035</CustomChar2>
<CustomChar3>16 701</CustomChar3>
<CustomNumeric1>0</CustomNumeric1>
<CustomNumeric2>16</CustomNumeric2>
</Line>
<Line>
<Quantity>-1200</Quantity>
<ItemNumber>NBM1221</ItemNumber>
<ProductDescription>NUT M12X1.5 X 21MM</ProductDescription>
<UnitWeight>.06</UnitWeight>
<CustomChar1>(PACK 100)</CustomChar1>
<CustomChar2>035</CustomChar2>
<CustomChar3>16 702</CustomChar3>
<CustomNumeric1>0</CustomNumeric1>
<CustomNumeric2>72</CustomNumeric2>
</Line>
<Line>
<Quantity>-1965</Quantity>
<ItemNumber>NBM1421</ItemNumber>
<ProductDescription>NUT M14X1.5 X 21MM</ProductDescription>
<UnitWeight>.1</UnitWeight>
<CustomChar1>(PACK 100)</CustomChar1>
<CustomChar2>035</CustomChar2>
<CustomChar3>16 703</CustomChar3>
<CustomNumeric1>0</CustomNumeric1>
<CustomNumeric2>196.5</CustomNumeric2>
</Line>
<Line>
<Quantity>-35</Quantity>
<ItemNumber>NBM1421</ItemNumber>
<ProductDescription>NUT M14X1.5 X 21MM</ProductDescription>
<UnitWeight>.1</UnitWeight>
<CustomChar1>(PACK 100)</CustomChar1>
<CustomChar2>035</CustomChar2>
<CustomChar3>16 703</CustomChar3>
<CustomNumeric1>0</CustomNumeric1>
<CustomNumeric2>3.5</CustomNumeric2>
</Line>
<Line>
<Quantity>-1100</Quantity>
<ItemNumber>NB050081</ItemNumber>
<ProductDescription>NUT 1/2 X 13/16</ProductDescription>
<UnitWeight>.06</UnitWeight>
<CustomChar1>(PACK 100)</CustomChar1>
<CustomChar2>035</CustomChar2>
<CustomChar3>16 701</CustomChar3>
<CustomNumeric1>0</CustomNumeric1>
<CustomNumeric2>66</CustomNumeric2>
</Line>
<Line>
<Quantity>-400</Quantity>
<ItemNumber>NF050075</ItemNumber>
<ProductDescription>NUT 1/2 X 3/4</ProductDescription>
<UnitWeight>.1</UnitWeight>
<CustomChar1>(PACK 100)</CustomChar1>
<CustomChar2>035</CustomChar2>
<CustomChar3>16 704</CustomChar3>
<CustomNumeric1>0</CustomNumeric1>
<CustomNumeric2>40</CustomNumeric2>
</Line>
<Line>
<Quantity>-800</Quantity>
<ItemNumber>NF050081</ItemNumber>
<ProductDescription>NUT 1/2 X 13/16</ProductDescription>
<UnitWeight>.14</UnitWeight>
<CustomChar1>(PACK 100)</CustomChar1>
<CustomChar2>035</CustomChar2>
<CustomChar3>16 705</CustomChar3>
<CustomNumeric1>0</CustomNumeric1>
<CustomNumeric2>112</CustomNumeric2>
</Line>
</TmsShipOrderDetail>
</TmsShipOrder>
</Transactions>

Top
#39076 - 04/03/12 06:59 AM Re: how to remove line # x to line # z [Re: sygui]
stuartg Offline
OL Expert

Registered: 03/06/03
Posts: 635
Loc: Swindon, England
OK, I see the problem here. Mainly its because I used [\s\S]* to match an unlimited number of characters. The problem is that [\s\S] matches anything, including new line characters and so if there is no match where I'm expecting it (within the <Line> </Line> delimiters), it will carry on looking until it reaches the end of file.

So I've replaced it with a search for a limited number of lines and this appears to work better.

Code:
(<Line>[\r\n]{1,2}(.*[\r\n]{1,2}){5,10}<CustomNumeric1>[^0].*[\r\n]{1,2}(.*[\r\n]{1,2}){2,4}</Line>[\r\n]{1,2})
(?:<Line>[\s\S]*?</Line>\r\n)




In "replace with" put $1.


Edited by stuartg (04/03/12 07:01 AM)

Top
#39077 - 04/03/12 09:12 AM Re: how to remove line # x to line # z [Re: stuartg]
sygui Offline
OL Guru

Registered: 11/02/10
Posts: 108
WORKS GREAT THKS

Top
#39486 - 05/07/12 12:57 PM Re: how to remove line # x to line # z [Re: stuartg]
sygui Offline
OL Guru

Registered: 11/02/10
Posts: 108
Hi Stuart,
last time you helped me a lot. I would still need your help: here is part of my file:
I need to remove all the text below if <Quantity>0</Quantity>
I have tried several things but it removes all blocks even if Quantity is not 0.

<Line>
<Quantity>0</Quantity>
<ItemNumber>x42661</ItemNumber>
<ProductDescription>MULTI 16X61/2 6-51/2</ProductDescription>
<UnitWeight>29</UnitWeight>
<CustomChar1>(SKID 30)</CustomChar1>
<CustomChar2>010</CustomChar2>
<CustomChar3>000000</CustomChar3>
<CustomNumeric1>120</CustomNumeric1>
<CustomNumeric2>116</CustomNumeric2>
</Line>

What I need is if <Quantity>0</Quantity> replace all between <Line> and </Line>. here is what I did but does not work:

search whole file, treat as regular expression:

<Line>
<Quantity>0</Quantity>
<ItemNumber>[\s\S]*</ItemNumber>
<ProductDescription>[\s\S]*</ProductDescription>
<UnitWeight>[\s\S]*</UnitWeight>
<CustomChar1>[\s\S]*</CustomChar1>
<CustomChar2>[\s\S]*</CustomChar2>
<CustomChar3>[\s\S]*</CustomChar3>
<CustomNumeric1>[\s\S]*</CustomNumeric1>
<CustomNumeric2>[\s\S]*</CustomNumeric2>
</Line>

Top
#39487 - 05/07/12 01:00 PM Re: how to remove line # x to line # z [Re: sygui]
Raphael Lalonde Lefebvre Offline
OL Expert

Registered: 10/14/05
Posts: 3631
Loc: Objectif Lune Montreal
Did you try the script I've posted in your other thread?

Top
Page 2 of 3 < 1 2 3 >