Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Input Deck Modification

Status
Not open for further replies.

psufan596

Programmer
Apr 20, 2008
2
US
I need to run an executable a number of times with modified input decks. The input deck I use is fixed format and I need to replace line 80 for each of the different runs. I was wondering how to open the input deck, go to line 80, REPLACE the text, save the input deck, and then execute the code. Any help would be GREATLY appreciated as I have to make a number of these runs.
 
I don't know what you mean by "input deck". I can tell you that if you are wanting to open a file and replace line 80 that it is trivial.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
Yes, I need to open a text file and replace line 80 with a new string for each run I need. Thanks.
 
There are a few different ways.. if you are already opening the data into an array you can just say
$array[79] = 'Blah Blah Blah';

or if you are going to open the file, write the data, then close the file and process it with some other program you might look at the Tie::File module.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
How do you know what line 80 will be changed to? Is that always the same or some random input you generate? Do you know any perl?

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
I'm confused about the database statement to. 400k lines by 25 files isn't to much for a database.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those who say it cannot be done are usually interrupted by someone else doing it; Give the wrong symptoms, get the wrong solutions;
 
Input deck: back in the day, this was a big stack of 80-column punched cards, sometimes with the added refinement of sequence numbers in columns 73-80 just in case you dropped them...

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
He has this question on a few forums so he may not respond back here.

------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top