Does anyone know Batch code.

Anything and Everything about Uplink

Moderators: jelco, bert_the_turtle, Chris, Icepick, Rkiver

On fire
level2
level2
Posts: 75
Joined: Sat Jun 08, 2002 12:33 am
Location: Houston T.X.
Contact:

Postby On fire » Fri Sep 06, 2002 2:40 pm

I posted this before but the topic is long since gone.
Ok how do I make a batch file append a txt fiile to another txt file? (Or apend text to the text file would be fine.)(Sorry if this is confusing.)
People that swear Don't know any more intelegent ways to express themself. :P
Procat_uplink
level0
Posts: 8
Joined: Fri Jan 11, 2002 1:28 am
Location: Denmark
Contact:

Postby Procat_uplink » Fri Sep 06, 2002 3:15 pm

Hmm... good old dos, jeez, I think the trick is some thing like this

C:\> test.txt < test2.txt

but Im really not sure...
Chad Mulligan
level2
level2
Posts: 127
Joined: Sat Jan 05, 2002 4:56 am
Location: Mountain View, CA

Postby Chad Mulligan » Fri Sep 06, 2002 3:32 pm

Look into the copy command.  If memory serves, you can do something like

"copy alpha + baker charlie"

and the file "charlie" will contain the contents of "alpha" followed by the contents of "baker".  You'd probably need to toss in a /B if you want to concatenate binary files, because I think it'll assume ASCII otherwise.

As for appending text, DOS may support the ">>" redirection syntax.  e.g.

 "blah.exe > foo"  will OVERWRITE foo, but
 "blah.exe >>foo"  should append blah's output to foo.

 "copy foo + CON:" should take input from CON:  (the console device) and concatenate it to "foo".

But it's been a while, and I'm on a 'nix, so test using toy files before you try with anything important.
"I tell you three times..."
On fire
level2
level2
Posts: 75
Joined: Sat Jun 08, 2002 12:33 am
Location: Houston T.X.
Contact:

Postby On fire » Fri Sep 06, 2002 3:40 pm

Ok Here is the code. I have two different ideas.


Author:On_fire
@echo off
cd data
h1.txt >> output.txt
:1
choice /c:yn texta
if errorlevel is 1 then goto texta
:2
choice /c:yn textb
if errorlevel is 1 then goto textb
:3
exit
:texta
texta.txt >> output.txt
goto 2
:textb
textb.txt >> output.txt
goto 3


Author:On_fire
@echo off
cd data
h1.txt >> output.txt
choice /c:yn texta
if errorlevel is 1 then goto texta.txt >> output.txt
choice /c:yn textb
if errorlevel is 1 then goto textb.txt >> output.txt
exit

I thought I had the code right but it is not working.
All the text files and the output.txt file are in a data folder. Anyone know why this won't work?


(Edited by On fire at 9:45 am on Sep. 6, 2002)


(Edited by On fire at 10:15 am on Sep. 6, 2002)
People that swear Don't know any more intelegent ways to express themself. :P
On fire
level2
level2
Posts: 75
Joined: Sat Jun 08, 2002 12:33 am
Location: Houston T.X.
Contact:

Postby On fire » Fri Sep 06, 2002 3:43 pm

And no the file is not finished. I wan't to get everything to work right first.
People that swear Don't know any more intelegent ways to express themself. :P
konrads_uplink
level0
Posts: 3
Joined: Wed Aug 28, 2002 4:01 pm
Location: Riga

Postby konrads_uplink » Fri Sep 06, 2002 3:43 pm

Just to contribute to junk @ uplink forums

1)  RTFM idiot
2) How exactly this is related to Uplink?
3) Are you 10 years old?
On fire
level2
level2
Posts: 75
Joined: Sat Jun 08, 2002 12:33 am
Location: Houston T.X.
Contact:

Postby On fire » Fri Sep 06, 2002 3:49 pm

  • WHAT!?!
  • It is for the forums.
  • No I'm 13 :P
People that swear Don't know any more intelegent ways to express themself. :P
coolsi
level5
level5
Posts: 3990
Joined: Wed Apr 10, 2002 6:46 pm

Postby coolsi » Fri Sep 06, 2002 4:09 pm

Quote: from konrads on 3:43 pm on Sep. 6, 2002[br]Just to contribute to junk @ uplink forums

1)  RTFM idiot
2) How exactly this is related to Uplink?
3) Are you 10 years old?

Shut up you n00b
Nakatomi is coming
On fire
level2
level2
Posts: 75
Joined: Sat Jun 08, 2002 12:33 am
Location: Houston T.X.
Contact:

Postby On fire » Fri Sep 06, 2002 6:27 pm

Any more help? Please?

(Edited by On fire at 12:39 pm on Sep. 6, 2002)
People that swear Don't know any more intelegent ways to express themself. :P
On fire
level2
level2
Posts: 75
Joined: Sat Jun 08, 2002 12:33 am
Location: Houston T.X.
Contact:

Postby On fire » Fri Sep 06, 2002 8:10 pm

Someone? Help? Please? Anyone?
People that swear Don't know any more intelegent ways to express themself. :P
Stewsburntmonkey
level5
level5
Posts: 11553
Joined: Wed Jul 10, 2002 7:44 pm
Location: Nashville, TN
Contact:

Postby Stewsburntmonkey » Fri Sep 06, 2002 8:18 pm

Here is a file that does what you want, I think.  I have not tested it.  :)

http://www.tl.infi.net/~wtnewton/batch/cram.htm

(Edited by Stewsburntmonkey at 2:19 pm on Sep. 6, 2002)
On fire
level2
level2
Posts: 75
Joined: Sat Jun 08, 2002 12:33 am
Location: Houston T.X.
Contact:

Postby On fire » Fri Sep 06, 2002 8:58 pm

Yes. Thank you. It worked just fine. Just fine. ;)
People that swear Don't know any more intelegent ways to express themself. :P

Return to “General”

Who is online

Users browsing this forum: No registered users and 20 guests