开发者

Writing string to a file in java

开发者 https://www.devze.com 2023-03-25 19:21 出处:网络
I have a file which contains sql statements. Now in this file, I want to add a word \"collate\" after every \'char()开发者_Python百科\' and \'varchar()\' in the file.

I have a file which contains sql statements. Now in this file, I want to add a word "collate" after every 'char()开发者_Python百科' and 'varchar()' in the file. How do you do that?


Iterate through the file line by line. On each String do two replaceAll( ... ) using your Strings above. Then write each line into a new File. When done, rename the original file to some back-up name and rename the new file to the original file's name.

Edit 1
I just noticed your javascript tag. So what type of problem is this, Java or Javascript?

0

精彩评论

暂无评论...
验证码 换一张
取 消