Cramped Lines of Code
Moderator: DosItHelp
-
- Posts: 65
- Joined: 08 Jun 2012 07:48
Cramped Lines of Code
Through youtube, I came across a link to pastebin, which held the code of a batch program. When I use the copy function on pastebin into a notepad, and test it, the program works great, but the coding of the program becomes all cramped; all on one line... But when I manually copy it, and paste it, the lines of code are on their respective lines, but it pops up with an error everytime I run it... Help?
Re: Cramped Lines of Code
Paste the two versions here - use code tags to avoid formatting problems please.
-
- Posts: 65
- Joined: 08 Jun 2012 07:48
Re: Cramped Lines of Code
I'll just post the pastebin link here. The code is extremely long...
http://pastebin.com/HAVciXK9
http://pastebin.com/HAVciXK9
Re: Cramped Lines of Code
I selected the RAW paste data and copied it to a file and there is no problems.
Note: I used notepad++ to past the data to the file.
Note: I used notepad++ to past the data to the file.
Re: Cramped Lines of Code
'
Go to that site, select copy to clipboard, save the file as in.TXT
run this file, save out.TXT as 'Space Invaders v 1.CMD', enjoy
LFtoCRLF.CMD
Couldn't test it still recovering from a recent OS corruption/boot failure of XP eg: ( choice missing )
.
Go to that site, select copy to clipboard, save the file as in.TXT
run this file, save out.TXT as 'Space Invaders v 1.CMD', enjoy

LFtoCRLF.CMD
Code: Select all
@echo off &setlocal disableDelayedExpansion &title %~n0
set "$iFile=in.TXT"
set "$oFile=ou.TXT"
echo.¯ '%$iFile%'
type "%$iFile%" &echo.
echo.® '%$iFile%'
more "%$iFile%" > "%$oFile%"
echo.
echo.¯ '%$oFile%'
type "%$oFile%" &echo.
echo.® '%$oFile%'
pause
exit

-
- Posts: 65
- Joined: 08 Jun 2012 07:48
Re: Cramped Lines of Code
Can you please explain this line of code to me?
echo.¯ '%$iFile%'
What is the purpose of that line after the echo.?
echo.¯ '%$iFile%'
What is the purpose of that line after the echo.?
Re: Cramped Lines of Code
'
When I wrote it, I added visual feedback to get a quick visual of the file being converted, you can safely remove it.
When I wrote it, I added visual feedback to get a quick visual of the file being converted, you can safely remove it.