EDIT: I was chastised for being off subject. I edited out the file method I used as an example and inserted C++ method from reality.
I am using C++ popen to issue a top command to get system information into my program, then into an xml file I can send off-system. I parse the output of top into various variables (painful bit of code) which get poled into the xml.
top very helpfully truncates it's output's width to fit on the screen even in batch mode where the output is redirected to a pipe.
popen( "top -b -n 1", "r" );
Works the same if the output is sent to a file.
Is there a way to tell top to show all its fields (in batch mode) even if they would fall off the right side of the screen?
NOTE: In my particular case, I ran my c++ top-parser on my workstation and got, say, 15 columns per PID. Then I changed to fewer characters in the line (bigger text). I completely lost the 15th field. Then I tried an in-between font and got all but one column of the 15th field back. That field ends in %st and I count on it saying that, not %s. Fixing this need to be generic, not based on individual cases.
Thanks for the help. I checked Google and it knows much about top, but just how to ask.....
NB: If you'd like to see this phenomenon, run top in your usual command window capturing the output to a file or pipe, then change the font in the window to have more characters on each line of the terminal window and rerun the command.