Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to use stata to process strings in text files?

    Dear Statalist:
    I have a .txt text,contains 100000 words.for example:
    ashi#sad#gfdg#fgd#bfdg#ghh#vfdh#hhh#uku#cvb#

    I want the txt became like this:
    ashi
    sad
    gfdg
    fgd
    bfdg
    ghh
    vfdh
    hhh
    uku
    cvb
    That is replace the # with Carriage return and line feed.

    So that with large number of words(for example 100000) in the txt ,I can use import delimited to import to stata.

    I would really appreciate some help and hope to have explained my problem adequately.
    With best regards.

  • #2
    See -help filefilter-. This built-in command will allow you to replace all instances of "#" with whatever end of line marker is appropriate for your operating system. You could then import your filtered file.

    Comment


    • #3
      The FileFilter command successfully solved my problem. Thank you so much,Mike.

      Comment

      Working...
      X