

InterviewSolution
Saved Bookmarks
1. |
Solve : Editting a file using a batch file? |
Answer» <html><body><p>I changed jobs and had to switch from doing my job in <a href="https://interviewquestions.tuteehub.com/tag/linux-1946" style="font-weight:bold;" target="_blank" title="Click to know more about LINUX">LINUX</a> to windows, and don't have much experience writing batch files. <br/><br/>The part I can't figure out is how to remove all instances of a string ('CCE1', for example) from a specific file. Could someone help me out, thanks!Please give "before and after" <a href="https://interviewquestions.tuteehub.com/tag/examples-251225" style="font-weight:bold;" target="_blank" title="Click to know more about EXAMPLES">EXAMPLES</a><br/> Quote from: kramer4717 on August 06, 2010, 11:56:00 PM</p><blockquote>I changed jobs and had to switch from doing my job in linux to windows, and don't have much experience writing batch files. <br/><br/>The part I can't figure out is how to remove all instances of a string ('CCE1', for example) from a specific file. Could someone help me out, thanks!<br/></blockquote> <br/>since you have linux experience, i am sure you know about *nix tools like sed, tr etc ? They have been ported to windows. you can download <a href="http://gnuwin32.sourceforge.net/packages/sed.htm">sed </a>, then simply<br/><br/> Code: <a>[Select]</a>c:\<a href="https://interviewquestions.tuteehub.com/tag/test-13460" style="font-weight:bold;" target="_blank" title="Click to know more about TEST">TEST</a>&<a href="https://interviewquestions.tuteehub.com/tag/gt-249387" style="font-weight:bold;" target="_blank" title="Click to know more about GT">GT</a>; sed -i.bak "s/CCE1//g" file<br/></body></html> | |