PDA

View Full Version : Multiline search/replace


Japster24
06-30-2011, 09:45 AM
I can't figure this out for the life of me. I'm no regex expert either. I need to search for a block of text and replace it with another. I tried doing something like this post: http://www.kinook.com/Forum/showthread.php?t=1561&highlight=multiple+replace

but couldn't get it to work.

===========
//Search for this//
<ItemGroup>
<ProjectReference Include="..\..\..\..\Components\Forms\v1.0\Source\Software. Forms1\Software.Forms1.VS2010.csproj">
<Project>{XYZ0E5AF-123F-12B3-9FDA-9ADE123FBEA8}</Project>
<Name>Software.Forms1.VS2010</Name>
</ProjectReference>
</ItemGroup>

//Replace with this//
<Reference Include="Software.Forms1">
<HintPath>..\..\..\..\Components\FormsAPI\V1.0\Build\DotNet\ Software.Forms1.dll</HintPath>
</Reference>


===========

any suggestions would be MUCH appreciated!

Thanks!
-jp

kinook
06-30-2011, 11:16 AM
I'm guessing that the ItemGroup element should remain and the ProjectReference element should be replaced by the Reference element? The attached sample demonstrates one way to do this (if the ItemGroup element should also be replaced, remove the ItemGroup lines from the 'replace matches with' field in the Replace in File action).

Japster24
06-30-2011, 12:18 PM
Perfect!! As always, you guys rock!

Do you have a paypal "tip" jar or something? Your support has been and remains epic.

Thanks again!
-jp

kinook
06-30-2011, 12:27 PM
You're welcome. We don't a tip jar as such, but feel free to send money via PayPal to orders@kinook.com if you'd like. Thanks.

Japster24
06-30-2011, 12:41 PM
Go buy some beer. Thanks guys! :)

kinook
06-30-2011, 12:46 PM
Thank you!