Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
plz forgive me if this is a repeated question..i saw few other posts in which it had replies saying to use .cpp and call it in .bat file and all...
but my situvation is im appending a text file with a batch file
echo mydata1,mydata2,mydata3,____________>> C:\sample.txtinhere wat i wanted to do is while writing these contents to sample.txt mydata1 should be on first line and mydata2 should be 2nd line and so on...
plz help meprogramming newbie :)

@echo off
echo mydata1 >> C:\sample.txt
echo mydata2 >> C:\sample.txt
echo mydata3 >> C:\sample.txt
=====================================
If at first you don't succeed, you're about average.M2

Hi FM,
I didn't take those to be file names.
Ya never know.
=====================================
If at first you don't succeed, you're about average.M2

Hi Judago,
Pretty neat.
What's with the red font? It's hard enouh to see anything with this washed out new 'look'.
=====================================
If at first you don't succeed, you're about average.M2

Hi Mechanix2Go,
I read that little tip at this site and it even works from the command line.
The orange font is actually supposed to make it easier to read and help distinguish between code and comment, I guess it's not working properly, any suggestions? I did it because I stopped using pre tags because the pages were stretching with long lines.

Yeah, I avoid the pre tag for just that reason. It makes clear where the line breaks are [and aren't] but it's a real pain to scroll left and right.
=====================================
If at first you don't succeed, you're about average.M2

Hey Judago, the theory's fine (at least I don't get any complaints), but you just need to pick a darker color. Lately, I've been using #AA0000; the color here (orange / 2) is #7F4000. Might also dabble with bolding (again, like this post).

Hi M2 & Judago,
My preference is to use pre tags because with the coding I do, it's important to retain the proper indentation of the code, as well as the line length. I try to stay within good coding practices and keep the line width below 80 chars.
I realize that the vast majority of batch coders don't use indentation, but they do use long line lengths. I've seen some coders (not here) with line widths above 500 chars. That's insane.
As for the horizontal scrolling, you guys must be using small monitors set to 800x600. My smallest is a 17in at 1024x768 and I haven't had a scrolling issue.

I've got a few batch's the have 800+ characters in line length :)
What good are &&, ||, nested if and for statements if we can't confuse the command interpreter by giving it commands longer than it can read?
As for my resolution it's 1024*768 on 14" crt. My problem is probably caused by my 137dpi setting and my size 20(point?) browser font.

I've got a few batch's the have 800+ characters in line length :)
lol, that's nuts, but I've seen worse. A few weeks ago I was helping someone that had lines that were over 2,000 characters.

Line length asidr, anyone care to give a quick lesson on || ?
=====================================
If at first you don't succeed, you're about average.M2

I thought I saw it used as XOR [non bitwise] but I can't make it work.
=====================================
If at first you don't succeed, you're about average.M2

Fine. One example, then you need to make a new thread.
dir "IDontExist" >NUL 2>&1 && (@ECHO File Exists) || @ECHO File not there

:O
i cant even able to relate wat u people talking on :(
neways tech geniuses u alli got answer for ma post ....once again thank you all for that :)
programming newbie :)

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |