Hello everyone...
Could someone please tell me how I can store a paragraph, or sentence lines e.g...
"I like the colour blue"
"I like pets"
"My favourite pet is a boxer dog"
Yes like that rather , How could I do that. With spaces, ect just in one variable.
So if I...
echo "%var%"
it would echo the lines, or something close to that, what every you can do will be great!
Thank you for your time, and helping everyone on the forum
how can I store a paragraph in a variable
Moderator: DosItHelp
Re: how can I store a paragraph in a variable
try this:
Code: Select all
@echo off &setlocal enabledelayedexpansion
set "myparagraph="I like the colour blue""I like pets""My favourite pet is a boxer dog""
set LF=^
REM ^two empty lines are important^
set "myparagraph=%myparagraph:""="!LF!"%"
echo !myparagraph!
Re: how can I store a paragraph in a variable
Thanks a lot for you help but is there any way to remove the ' " ' from the lines?
Thank you for all your time
Thank you for all your time
Re: how can I store a paragraph in a variable
But your example lines are double quoted.
Think a bit more carefully about your question... and explain why you need to do it.
There are a mountain of tricks and techniques that could work, if the actual task is described.
Think a bit more carefully about your question... and explain why you need to do it.
There are a mountain of tricks and techniques that could work, if the actual task is described.
Re: how can I store a paragraph in a variable
Thank you @foxidrive
and here the code:
and here the code:
Code: Select all
@echo off &setlocal enabledelayedexpansion
set "myparagraph=I like the colour blue""I like pets""My favourite pet is a boxer dog"
set LF=^
REM ^two empty lines are important^
set "myparagraph=%myparagraph:""=!LF!%"
echo !myparagraph!
Re: how can I store a paragraph in a variable
Hello...
Um, sorry about that? How do I remove the ' quotes ' from each line
Thanks you for all your help
Um, sorry about that? How do I remove the ' quotes ' from each line
Thanks you for all your help
Re: how can I store a paragraph in a variable
It's done. See above.
Re: how can I store a paragraph in a variable
Oh sorry I did not realise, thank you guys so much for the code. And thank you for all your time aswell