I have a program that require all keywords to be in a single paragraph, most of the time, separated by commas

For example:

I have those terms

1-Term
1.1-Term
2-Term
3-Term
4-Term

That i collected and organized into groups and subgroups with Titles and subtitles

Title

  • 1-Term

  • 1.1-Term

  • 2-Term

    • Sub-Title
      • 3-Term
      • 4-Term

But then i want to turn them into:

1-Term, 1.1-Term, 2-Term, 3-Term, 4-Term 
 

Removing certain marked words(Titles and sub-Titles), any Empty/Blank space, and Line breaks, while adding the commas between The Terms. I want to keep certain dashes “-”(like in words )

1-Term,1.1 -Term,2-Term,3-Term,4-Term

  • Cactus_Head@programming.devOP
    link
    fedilink
    English
    arrow-up
    1
    ·
    edit-2
    6 days ago

    Basically i collect keywords( e.g: transformers, A Deep dive, Harry Potter The worst, Xbox, stars worst, Jedi) from videos on my YouTube home page and organize them into a lists

    • YouTuber terms:

      • A Deep Dive
      • The Worst

    • Franchises:
      • Star wars
      • Jedi
      • Harry Potter
      • Transformers

    • Companies:

      • Xbox

    And Turn it into:

    A Deep Dive,The Worst, Star wars, Jedi, Harry Potter, Transformers,Xbox  
    
    

    Removing the titles and subtitles.

    How do you tell text and title/subtitle apart

    I was thinking of putting a symbol like “#” for example, in front of the Title

    # - YouTuber terms:  
    

    so the script knows to ignore that whole line, like in general programming