Skip to main content
Solved

Replacing two lines of a text file in FME DESKTOP 2013

  • September 23, 2013
  • 1 reply
  • 23 views

Forum|alt.badge.img
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

Best answer by davideagle

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.
View original
Did this help you find an answer to your question?
This post is closed to further activity.
It may be a question with a best answer, an implemented idea, or just a post needing no comment.
If you have a follow-up or related question, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

1 reply

davideagle
Contributor
Forum|alt.badge.img+21
  • Contributor
  • Best Answer
  • September 23, 2013
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.

Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings