E-mail attachment with scrambled text.

vino.B bheeman.vino at hotmail.com
Thu Jun 28 14:42:36 UTC 2018


On Thursday, 28 June 2018 at 12:36:11 UTC, Simen Kjærås wrote:
> On Thursday, 28 June 2018 at 11:46:31 UTC, vino.B wrote:
>> Output in Linux
>> ************Server Details******************
>> Server Name : 1XXXX     IP: 1XXXXXX
>> Server Name : 2XXXX     IP: 2XXXXXX
>> Server Name : 3XXXX     IP: 3XXXXXX
>> ********************************************
>>
>> The output in Windows(Email attachment) all are in single line
>>
>> ************Server Details******************Server Name : 1XXXX
>>   IP: 1XXXXXXServer Name : 2XXXX     IP: 2XXXXXX Server Name : 
>> 3XXXX     IP: 3XXXXXX
>> ********************************************
>
> Looks to be an issue with newlines. In linux, a newline is 
> simply \n. In Windows it's \r\n, and some Windows programs get 
> confused when they just see a \n, notably notepad. Notepad++ 
> and basically any other editor will handle Unix newlines 
> correctly.
>
> --
>   Simen

Hi Simen,

  Thank you very much, after replacing all the '\n' with '\r\n' it 
resolved 99% of the formatting issue expect for the below 
function, can you help me on the same.

auto getAvailableDiskSpace(Array!string UtilDrive, File logF) {
auto result = ["/usr/bin/df", "-h", UtilDrive, 
"--output=target,size,used,avail,pcent"].execute;
enforce(result.status == 0);
logF.writeln(result.output);

}

The output of the above code is as below(Single line)

Mounted on  Size  Used Avail Use%/backup     3.0T  2.6T  393G  87%


From,
Vino.B






More information about the Digitalmars-d-learn mailing list