cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

input statement supresses heading whitespaces

Baron
Participant
0 Likes
2,602

I am trying to read the results of SYSTEMINFO in a table, and then distribute each line in columns.

  • xp_cmdshell 'systeminfo > c:\\temp\\ssss.txt';
  • input into mytest from 'c:\\temp\\ssss.txt';

Visually (on CMD) I can recognize the subresults, because whitespaces are added to each subresult, but, when I 'input' the results into a table then all heading whitespaces are supressed!

So, the following lines (from ssss.txt):


Hotfix(es):                                    7 Hotfix(e) installiert.
                                               [01]: KB4533002

Are imported in the table as:


Hotfix(es):                                    7 Hotfix(e) installiert.
[01]: KB4533002

Is there a way to import the whitespaces as they are?

One more question, is there a way to eliminate the need of the temporary file (ssss.txt)? so that to capture the output of a command issued by xp_cmdshell?

View Entire Topic
MarkCulp
Participant

If you are wanting to read the file with no changes made to its content, a simple solution would be to use xp_read_file().

Baron
Participant
0 Likes

Yes, I used this procedure to read the file 'binary'