tags:

views:

46

answers:

3

In a program am getting one input say name....

From a file i read value line by line: say file contains...

hello
hai

If i want to print like

hello name in batch file
hai name in batch file

How to do this?

A: 

For Windows command line use

ECHO %1
Yada
for %%a in wish.txt Do type %%a prints only hello haihow to incorporate type and echo in a for loop?
anitha
A: 

How about a Perl Solution:

#!/usr/bin/perl -w

my $file = "file.txt";
open(INFO,"<$file") or die "can't open file" ;

while(<INFO>)
{
  chomp $_;
  print "$_ name in batch file\n" ;
}
Neeraj
A: 
paxdiablo
i used for name in echo likeecho %%a %name% in batch file but not works....
anitha
You need to ensure that name is defined, as in 'set name=Bob' before the for statement.
paxdiablo