Solved

Replacing two lines of a text file in FME DESKTOP 2013

  • 23 September 2013
  • 1 reply
  • 5 views

Badge
Hi,

 

   Following is part of my text file.

 

"

 

#! DB_USER_ID:

 

#! VALUE:'ORACLE'

 

#! DB_PASSWORD:

 

#! VALUE:'systemUser'

 

"

 

I want to replace only  value of DB_USER_ID to 'ORACLE_9i'.

 

 but whenever i am trying to search with "

 

#! DB_USER_ID:

 

#! VALUE:'ORACLE'

 

" directly or with "#! DB_USER_ID:\\n#! VALUE:'ORACLE'" with new line character, i am not getting any o/p in StringReplacer.

 

 

Please let me know the resolution.

 

 

Thanks.

 

Subrat
icon

Best answer by davideagle 23 September 2013, 13:08

View original

1 reply

Badge +10
Assuming you are using the Text reader then set the parameters to "Read whole file at once" = NO. And "Read bottom up" = NO. Then each line will come through as a feature single feature. You'll then beable to give them each an ID to allow inserting back into the target text file. Then search and replace the first feature from #! VALUE:'' to #! VALUE:'ORACLE_9i' and then do the second value string. All possible because each line of the text file is read as 1 feature and in order from top to bottom.

 

 

Hope that helps.

Reply