story-wide search (and replace) function?

Discussion in 'Authors' Hangout' started by zankoo, Dec 15, 2023.

  1. zankoo

    zankoo Really Experienced CHYOA Backer

    Does anyone know if there's a way to search an entire story for a given word?

    The real question/situation -- I want to change the name of one of my characters. I know she appears in like a hundred chapters, but I don't necessarily remember exactly which hundred. I would love to be able to log in, edit my content, and do a massive search-and-replace to swap out 'Gwendolyn' for 'Cecily' (or something along those lines).

    No, I don't need to do it to other people's content, just my own.

    Any thoughts?
     
  2. Dansak

    Dansak Really Really Experienced

    I'm not aware of any function that would do this. Do you have a copy of your work saved somewhere else?

    I write on a word doc then save it and copy across to Chyoa. If I needed to switch the name out then all I could think to do would be to go through my word doc using the search function and use that as a guide to find the name on Chyoa.

    The only other option I can see is going through each chapter one by one.
     
    zankoo likes this.
  3. zankoo

    zankoo Really Experienced CHYOA Backer

    Yes, I have most of it in other places -- though even if I was able to reliably track the name in a Word doc, I'd still have to go into each CHYOA chapter one-by-one, change each name one-by-one, and then resave (while clicking the 'edit silently' button each time). It's all possible, just time consuming.

    I'm reluctant to just copy-and-paste from Word again since things like italics, horizontal lines, etc. don't translate.

    Maybe I should just suck it up and accept the original names. :)
     
    Dansak likes this.
  4. Dansak

    Dansak Really Really Experienced

    Yeah, Unless there's a real issue with the name that affects the story somehow then I'd just accept it too, it's a lot of work.
     
    zankoo likes this.
  5. zankoo

    zankoo Really Experienced CHYOA Backer

    I typically avoid names of people I know in real life. And when I meet someone new in real life -- and if that someone begins to take a major role in my real life (family, work, etc.), I look back on old writing and wonder how I could edit the past to retroactively avoid those names.

    I mean ... do you really want your whore/slut/villain/tentacle-fetish/etc. to have the same name as your newest niece? I didn't think so ...
     
    Dansak likes this.
  6. Dansak

    Dansak Really Really Experienced

    Ah yeah, that is an issue. I avoid names of people I know too, which often means I end up re using names quite a bit. I think I've used Katie two or three times now for a main character. If I then had a new niece called Katie, yeah, I'd have to go through and change it.
     
    zankoo likes this.
  7. zankoo

    zankoo Really Experienced CHYOA Backer

    I suppose the alternative is to commit to going the rest of my life without meeting anyone new ... Maybe I'll try that and see how it fares.
     
    Dansak likes this.
  8. gene.sis

    gene.sis CHYOA Guru

    As of now, that's not possible.

    I think it would be good to have a feature (for story owners/editors) that allows searching the story for keywords.
    I'm not sure whether there is already a suggestion for that, though it might be worth adding one.

    Though, I don't think search and replace would be a good thing. While your example seems reasonably exact, there might be some terms that might be parts of other terms. So if you apply a change to 100 chapters, a small error might lead to a big mess that might be very difficult to reverse.

    Depending on your CHYOA settings, you can edit chapters in Markdown. (As they are saved in the database.)
    Some desktop editors allow you to create Markdown.
    (You could also write in plain Markdown in the first place.)
    If you want to back up, you could change the settings before opening chapters and copy their content, and change back before opening chapters to write/edit them.


    Using immersion variables might do the trick (for main characters) as their default can be changed on the edit story page.
    There is the issue with nicknames and things like "Oh Ce-ce-cily!" though that wouldn't be caught by search and replace anyway.
     
    zankoo likes this.
  9. vyksin

    vyksin Virgin CHYOA Backer

    I have a powershell script I run to replace character names with the variables for the customization on this site. It works with the clipboard so I just copy the whole story, run the script, and then paste it as it has all the updates. You could easily use it for character names too if you are interested.

    Edit: here is a link to the script I made for search and replace of names: https://1drv.ms/u/s!AoQAVTyJxTv2h1aFE8o3t12TNo1b?e=cqEvjR
     
    Last edited: Dec 20, 2023
    gene.sis and Dansak like this.