Printing a string of Characters and integers

closed account (N1Co216C)
Hello,

I was wondering if there is a way to have a program output a string with both characters and integers. What I want to do is create a program that can import the following data (see below) from a .txt file and put each line into a spot in an array. I then want the data to be displayed one name at a time, incrementing to the next line of data (the next subscript of the array) each time the program is run.

D101576
D101599
D101618
D102003
D102414
D103348
D103407
D103423
D103505
D103896
D103910
D104198
D104203
D104215
D104239
D104361

The output should look like this:


D101576


//end program


D101599


//end program

...and so on, incrementing to the next line of data every time the program is run, until the end of the .txt file is reached.




Any help would be greatly appreciated!
Last edited on
So after one run, the program exits and next time you totally restart it?
In this case, I'd recommend you to use some log file which stores, which line comes in the other file.
closed account (N1Co216C)
Yes the program has to restart every time but remember where it left off. Reason being, I am trying to see if it is possible to incorporate a C++ program into a Powershell script. The goal is to have powershell run the C++ program to output one line of data from the .txt file (each line is a computer name), then execute a bunch of powershell script, then loop back to the C++ file to go to the next computer name in the sequence, run the powershell script for that computer, and so on, until all computers on the list have run the powershell script.
Why can't you just get the Powershell script to read the file?

Or will the program be doing something other than just reading a file in the future?

Andy
Topic archived. No new replies allowed.