0

I am not good in computers so pardon me if this is stupid. I have around 4800 text files in a folder (all have list of stocks and their OHLC values for each day of an exchange) where in the past some of the symbol names have changed.

I have a list of more than 500 old and new symbol names. What I wish to do is replace the old symbols with new symbols one by one (not all at once as there are multiple symbol name changes for a stock in the past).

The only problem is:

  1. I cannot do it manually as it is a really long list.
  2. I cannot do it all in bulk as stated in the link here because it breaks the data (due to multiple name changes in the past). Multiple word search and replace in notepad++

So is there a way you can suggest that I can do one by one replacement automatically in multiple files?

One of the 4800+ txt files

List of symbols to be renamed

Community
  • 1
  • 1
  • Please include a partial example of one of the 4800 files, and also of the file containing the old and new symbol names. Clarify what you mean by "not all at once as there are multiple symbol name changes...". – ReluctantBIOSGuy Jul 11 '16 at 15:40
  • I have attached the screenshots and what I mean by 'not all at once' is that I want each of the renames to be done individually and not at once. – Rusty Banks Jul 11 '16 at 16:06
  • I still do not understand what you mean by "not all at once as there are multiple symbol name changes **in the past**". Are you saying that some symbol may have changed values from, say, "X" to "XNEW" to "XFINAL", and it may appear as "X" and/or "XNEW" in the 4800 files? Whatever the answer, you will likely need to use a macro, or bypass the editor altogether and use some scripting language like AWK, PERL, or Python. – ReluctantBIOSGuy Jul 11 '16 at 16:16
  • Yes sir, that is what I mean. Is there a way I could use this Python on multiple files? [link](http://stackoverflow.com/a/16197147/2105478) – Rusty Banks Jul 11 '16 at 17:17

0 Answers0