-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmake-a-folder-of-prompts-from-a-simple-txt-file.html
More file actions
23 lines (22 loc) · 9.6 KB
/
Copy pathmake-a-folder-of-prompts-from-a-simple-txt-file.html
File metadata and controls
23 lines (22 loc) · 9.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html><html lang="en-gb"><head><meta charset="utf-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><meta name="viewport" content="width=device-width,initial-scale=1"><title>make a folder of prompts from a simple txt file - graphicdesigngeek.com</title><meta name="description" content="$sourceFile = "C:\Users\username\Desktop\text\weird.txt" $delimiter = "\n" $splitFilePrefix = "C:\Users\username\Desktop\weird1\weird_" $counter = 1 $content = Get-Content -Path $sourceFile -Raw $chunks = $content -split $delimiter foreach ($chunk&hellip;"><meta name="generator" content="Publii Open-Source CMS for Static Site"><style>.copy-text{position:relative;padding:20px;padding-top:calc(16px * 2)!important;background-color:#403B3B;border-radius:5px;}.copy-icon{position:absolute;top:calc( 16px / 2);right:calc( 16px);cursor:pointer;display:flex;align-items:center;}.copy-icon svg{width:16px;stroke:#0885E7;}.copy-icon-text{margin-left:8px;font-size:0.75rem;color:#0885E7;}.copy-popup{position:absolute;top:50%;right:115%;transform:translateY(-50%);background-color:rgba(0,0,0,.8);color:#EB1111;padding:2px 6px;font-size:0.75rem;border-radius:4px;white-space:nowrap;}</style><link rel="canonical" href="https://graphicdesigngeek.com/make-a-folder-of-prompts-from-a-simple-txt-file.html"><link rel="alternate" type="application/atom+xml" href="https://graphicdesigngeek.com/feed.xml" title="graphicdesigngeek.com - RSS"><link rel="alternate" type="application/json" href="https://graphicdesigngeek.com/feed.json" title="graphicdesigngeek.com - JSON"><meta property="og:title" content="make a folder of prompts from a simple txt file"><meta property="og:image" content="https://graphicdesigngeek.com/media/posts/3/new-anima-test_832486031203768_00001_.png"><meta property="og:image:width" content="832"><meta property="og:image:height" content="1216"><meta property="og:site_name" content="graphicdesigngeek.com"><meta property="og:description" content="$sourceFile = "C:\Users\username\Desktop\text\weird.txt" $delimiter = "\n" $splitFilePrefix = "C:\Users\username\Desktop\weird1\weird_" $counter = 1 $content = Get-Content -Path $sourceFile -Raw $chunks = $content -split $delimiter foreach ($chunk&hellip;"><meta property="og:url" content="https://graphicdesigngeek.com/make-a-folder-of-prompts-from-a-simple-txt-file.html"><meta property="og:type" content="article"><link rel="stylesheet" href="https://graphicdesigngeek.com/assets/css/style.css?v=26ea6dbd5f9804efdb1c0d7cabfef8b8"><script type="application/ld+json">{"@context":"http://schema.org","@type":"Article","mainEntityOfPage":{"@type":"WebPage","@id":"https://graphicdesigngeek.com/make-a-folder-of-prompts-from-a-simple-txt-file.html"},"headline":"make a folder of prompts from a simple txt file","datePublished":"2026-07-04T16:34-04:00","dateModified":"2026-07-04T17:11-04:00","image":{"@type":"ImageObject","url":"https://graphicdesigngeek.com/media/posts/3/new-anima-test_832486031203768_00001_.png","height":1216,"width":832},"description":"$sourceFile = \"C:\\Users\\username\\Desktop\\text\\weird.txt\" $delimiter = \"\\n\" $splitFilePrefix = \"C:\\Users\\username\\Desktop\\weird1\\weird_\" $counter = 1 $content = Get-Content -Path $sourceFile -Raw $chunks = $content -split $delimiter foreach ($chunk…","author":{"@type":"Person","name":"admin","url":"https://graphicdesigngeek.com/authors/admin/"},"publisher":{"@type":"Organization","name":"admin"}}</script><noscript><style>img[loading] {
opacity: 1;
}</style></noscript></head><body class="post-template"><div class="container container--center"><header class="header"><div class="header__logo"><a class="logo" href="https://graphicdesigngeek.com/">graphicdesigngeek.com</a></div><nav class="navbar js-navbar"><button class="navbar__toggle js-toggle" aria-label="Menu" aria-haspopup="true" aria-expanded="false"><span class="navbar__toggle-box"><span class="navbar__toggle-inner">Menu</span></span></button><ul class="navbar__menu"><li><a href="https://graphicdesigngeek.com/" target="_self">Home</a></li><li><a href="https://graphicdesigngeek.com/" target="_self">Posts</a></li><li><a href="https://graphicdesigngeek.com/tags/comfyui/" target="_self">Comfyui</a></li><li><a href="https://graphicdesigngeek.com/tags/powershell/" target="_self">Powershell</a></li><li><a href="https://graphicdesigngeek.com/tags/minimax/" target="_self">Minimax</a></li><li><a href="https://graphicdesigngeek.com/tags/krea2/" target="_self">Krea2</a></li></ul></nav></header><main class="content"><article class="post"><header><h1 class="post__title">make a folder of prompts from a simple txt file</h1><div class="post__meta"><time datetime="2026-07-04T16:34" class="post__date">July 4, 2026 </time><span class="post__author"><a href="https://graphicdesigngeek.com/authors/admin/" class="feed__author">admin</a></span></div><div class="post__tags"><a href="https://graphicdesigngeek.com/tags/powershell/" class="invert">powershell</a></div></header><figure class="post__image post__cover"><img src="https://graphicdesigngeek.com/media/posts/3/new-anima-test_832486031203768_00001_.png" srcset="https://graphicdesigngeek.com/media/posts/3/responsive/new-anima-test_832486031203768_00001_-xs.png 300w, https://graphicdesigngeek.com/media/posts/3/responsive/new-anima-test_832486031203768_00001_-sm.png 480w, https://graphicdesigngeek.com/media/posts/3/responsive/new-anima-test_832486031203768_00001_-md.png 768w, https://graphicdesigngeek.com/media/posts/3/responsive/new-anima-test_832486031203768_00001_-lg.png 1024w" sizes="(min-width: 920px) 703px, (min-width: 700px) calc(82vw - 35px), calc(100vw - 81px)" loading="eager" height="1216" width="832" alt=""><figcaption>image created with model from civitai https://civitai.red/models/2270685/animazingxl</figcaption></figure><div class="post__entry"><pre class="language-powershell"><code>$sourceFile = "C:\Users\username\Desktop\text\weird.txt"
$delimiter = "\n"
$splitFilePrefix = "C:\Users\username\Desktop\weird1\weird_"
$counter = 1
$content = Get-Content -Path $sourceFile -Raw
$chunks = $content -split $delimiter
foreach ($chunk in $chunks) {
$fileName = $splitFilePrefix + $counter.ToString("000")+".txt"
$chunk | Set-Content -Path $fileName
$counter++
}</code></pre><p>this works assuming that you have 1 prompt per line with \n a line break </p><p>the script will go line by line and make a txt file for each line in the txt file</p><p>put this code above in a txt file, rename the txt file to anything and change the file from samplename.txt to samplename.psl</p><p>$sourceFile = location and name of file to break up into many files</p><p>$delimiter = the way for the code to know when to go to next line</p><p>$splitFilePrefix = folder location and prefix for each new file which will be numbered</p><p>then open powershell in folder with the .\\samplename.ps1 file you created</p><p>and run</p><pre class="language-powershell"><code>.\\samplename.ps1</code></pre><p>all images used on this site are from</p><p><a href="https://civitai.red/user/mystifying">https://civitai.red/user/mystifying</a></p><p>this image uses this model:</p><p><a href="https://civitai.red/models/2270685/animazingxl">https://civitai.red/models/2270685/animazingxl</a></p><p> </p></div><footer class="wrapper post__footer"><p class="post__last-updated">This article was updated on July 4, 2026</p><div class="post__share"></div></footer><nav class="pagination"><div class="pagination__title"><span>Read other posts</span></div><div class="pagination__buttons"><a href="https://graphicdesigngeek.com/how-to-unpin-all-nodes-in-comfyui-workflow.html" class="btn previous" rel="prev" aria-label="[MISSING TRANSLATION]: how to unpin all nodes in comfyui workflow "><span class="btn__icon">←</span> <span class="btn__text">how to unpin all nodes in comfyui workflow</span> </a><a href="https://graphicdesigngeek.com/getting-prompt-or-comfyui-workflow-from-posted-images-on-reddit.html" class="btn next" rel="next" aria-label="[MISSING TRANSLATION]: Getting prompt or ComfyUI workflow from posted images on Reddit "><span class="btn__text">Getting prompt or ComfyUI workflow from posted images on Reddit</span> <span class="btn__icon">→</span></a></div></nav></article></main><footer class="footer"><div class="footer__inner"><div class="footer__copyright"><p>© 2024 Powered by Publii CMS :: <a href="https://github.com/panr/hugo-theme-terminal" target="_blank" rel="noopener">Theme</a> ported by the <a href="https://getpublii.com/customization-service/" target="_blank" rel="noopener">Publii Team</a></p></div></div></footer></div><script defer="defer" src="https://graphicdesigngeek.com/assets/js/scripts.min.js?v=c2232aa7558e9517946129d2a1b8c770"></script><script>window.publiiThemeMenuConfig={mobileMenuMode:'sidebar',animationSpeed:300,submenuWidth: 'auto',doubleClickTime:500,mobileMenuExpandableSubmenus:true,relatedContainerForOverlayMenuSelector:'.top'};</script><script>var images = document.querySelectorAll('img[loading]');
for (var i = 0; i < images.length; i++) {
if (images[i].complete) {
images[i].classList.add('is-loaded');
} else {
images[i].addEventListener('load', function () {
this.classList.add('is-loaded');
}, false);
}
}</script><script>window.iconChoice = 1;window.iconSize = 16;window.iconColor = '#0885E7';window.txtLabel = 'Copy Text';window.txtMessage = 'Copied!';window.txtTime = 1500;</script><script src="https://graphicdesigngeek.com/media/plugins/copy-text/copyText.min.js" defer="defer"></script></body></html>