views:

90

answers:

3

Hi guys, I am looking for your help on the following.

I am going to read a value in a.txt, and put it as an input for b.txt The problem is, in a.txt, the value will keep changing due to iteration process. So, it is better to point a pointer to WHERE the value will appear. Ex. (as in a.txt file)

X = 12345

so, i would like to point where is X, and then read the value next to X, put it as input to b.txt.

I hope that it is possible using batch file in Windows command prompt.

A: 

If your file a.txt doesn't change in size, your best option is to save the line number where the thing you're looking for is.

Davide
A: 

Sorry guys, i guessed my explanation is not enough. Let me try again. Let say i have a file a.dat, b.dat

In file a.dat,

x = 12345

In file b.dat

y = 54321

The position of the line in both files is the same for every execution (with other application that is not batch/ms-dos)

I want to pick up the value in a.dat of 12345 , which is next to x, that replace the value in b.dat, which is 54321 with 12345, so that in b.dat will be as follow.

y = 12345

My questions are,

  1. How can i point the value next to "x = ", and than put this value in b.dat next to "y = "?

I hope that is explained. Sorry for my bad explanation.

kemarol
okay, so you want to ask something like "how can I replace the value on line 50 of b.txt with the value from line 20 of a.txt?" Is that right?
Stobor
A: 

Exactly mr.Stobor!

kemarol
You should edit your question and delete all these answers which are creating only confusion!
Davide