Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: Use Regular Expressions to replace words/strings of characters in a text file


From   Nick Cox <njcoxstata@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: Use Regular Expressions to replace words/strings of characters in a text file
Date   Wed, 15 Aug 2012 01:07:39 +0100

-help filefilter-

Nick

On Tue, Aug 14, 2012 at 9:18 PM, tashi lama <ltashi32@hotmail.com> wrote:

>     I looked for previous posts and read and still can't find the solution. I could use stata's string functions(regexr, subinstr etc) to search and replace string in a string. But if I have a text file(test1.xml) that I need to run a search and replace on, how do I do it? Putting a text in a local macro( put aside the macro limitation)  and using regexr wouldn't be an option because I have to generate a  xml file from the dataset.
>
> view test1.xml
>
> <?xml version="1.0" encoding="US-ASCII" standalone="yes"?>
> <?mso-application progid="Excel.Sheet"?>
> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index