Search & Replace Task - Search for multiple rows

View some of the Frequently Asked Questions to our support staff. Included are some tips and tricks making this forum ideal for users getting started with GoAnywhere Director. Note: Users can reply to existing topics but only our support staff can add new topics to this forum.

Search & Replace Task - Search for multiple rows

Postby Support_Duane » Mon Mar 23, 2009 10:47 am

The Search and Replace task is able to read multiple lines in the input file at a time. It is designed to read chunks of data and not line by line. In order to span multiple lines, use the special characters such as:
\r - Carriage Return
\n - Line Feed

Let's say you have an XML file and you want to search for a block of text like in the example below.
Code: Select all
<OTHER_DIAG_CODE>
    <DIAG_CODE></DIAG_CODE>
    <PRESENT_ON_ADMIT></PRESENT_ON_ADMIT>
</OTHER_DIAG_CODE>


You should enter the following value into the Search For attribute in the Search and Replace task:
Code: Select all
<OTHER_DIAG_CODE>\r\n  <DIAG_CODE></DIAG_CODE>\r\n  <PRESENT_ON_ADMIT></PRESENT_ON_ADMIT>\r\n</OTHER_DIAG_CODE>


Note: The end of line characters may be different on different systems (they may be just line feeds '\n' instead of carriage return-line feeds '\r\n') and the file may contain tabs instead of spaces. This example uses spaces, but the special tab character '\t' may be used instead. It all depends on how the file is formatted.
Support_Duane
Support Specialist
 
Posts: 65
Joined: Thu Mar 05, 2009 3:49 pm

Return to Knowledge Center

Who is online

Users browsing this forum: No registered users and 3 guests