My Computer Forum Computer Science Forum

Go Back   My Computer Forum > Computer Science Forum > Programming

Programming Programming Languages, Interpreters, and Compilers - Assembly, Declarative, Machine, Object Oriented, Iterative


Reply
 
LinkBack Thread Tools Display Modes
December 7th, 2008, 02:30 PM   #1
 
Joined: Dec 2008
Posts: 30
Redirection in Batch

I am using Batch in XP. I have two text files named C:\rpe\listfilesnum.txt and C:\rpe\num.txt.

1. I want to get the text in listfilesnum.txt and store it in the variable %nenum%. I tried
"set /p menum=<C:\rpe\listfilesnum.txt"
exactly like that but it doesn't seem to work.

2. I also want to store the contents of a variable %num% into num.txt. I tried
"echo %num% >C:\rpe\num.txt"
exactly like that but it adds an extra space after the variable's contents. I tried
"echo %num%>C:\rpe\num.txt"
with no space after the %num% but it gives "ECHO is off".

How do I solve these problems?
SidT is offline  
 

My Computer Forum is free to register and we welcome everyone!

June 7th, 2009, 12:35 PM   #2
 
Joined: Dec 2008
Posts: 30
Re: Redirection in Batch

I suppose it was a rather unusual question, but after several attempts, I worked it out.
SidT is offline  
Reply

  My Computer Forum > Computer Science Forum > Programming

Tags
batch, redirection



Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
batch script to auto install applications rockin1jr Computer Science 0 November 8th, 2012 07:58 AM
Create a batch file to silent install multiple progams devvaibhav Computer Science 9 October 16th, 2012 07:59 AM





Copyright © 2018 My Computer Forum Forum. All rights reserved.