Create Multiple Text Files

Discussion in 'Mac Programming' started by gilgil2, Aug 23, 2011.

  1. gilgil2 macrumors newbie

    Joined:
    Aug 23, 2011
    #1
    Hi, I am not sure this is the right place to post, but it seemed the most appropriate.

    I have a list of several thousand names (stock tickers) and would like to turn each one into a .php file with exactly the same content, as the content is then generated from the file name.

    Is there a quick way to do this, or do I need to do each one individually?

    Thanks
     
  2. Hansr macrumors 6502a

    Joined:
    Apr 1, 2007
    #2
    You can easily do this in the shell by reading the tickers from a text file and have a base .php file and then just copy it with the new names with a loop. But it seems pointless. What are you trying to achieve?
     
  3. gilgil2 thread starter macrumors newbie

    Joined:
    Aug 23, 2011
    #3
    It is for a website, so each company has a page with a price quote, chart and articles on. The content of the page is already written, I just need the files to be created, as it takes the filename and uses that to get the quotes, charts, <title> etc.
     
  4. Hansr macrumors 6502a

    Joined:
    Apr 1, 2007
    #4
    Why not display.php?ticker=BLAH

    With obvious sanitation.
     

Share This Page