Link to home
Start Free TrialLog in
Avatar of CCG3
CCG3Flag for United States of America

asked on

Change number format

I am running a vb script that saves to a csv file. I have a number that is coming over with comas included so it is causing problems when I open it  up in excel. Can anyone tell me how to format this so that it still works the same but the output of fsize does not have any commas?

thanks for your help!


If InStr(strText,"Size:         ")>0 Then
            fsize=Replace(strText,"Size:         ","")
            fsize=Replace(fsize," bytes","")
            fsizedbl=CDbl(fsize)
           ' WScript.Echo "File size " & fsizedbl
            outputfile.WriteLine strcomputer & "," & folder & "," &  fsize
            Exit Do
        End If

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of Mechanic_Kharkov
Mechanic_Kharkov
Flag of Ukraine image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of CCG3

ASKER

I changed it to this.. but now it looks like it works fine for me.
outputfile.WriteLine strcomputer & "," & folder & "," &  Replace(fsize, ",", "")  '

Open in new window

:-) Sorry, I've thought that comma is decimal separator. In my place (Ukraine) decimal separator is usually comma, but some software uses a dot instead. But if you have commas as thousands separator, then there is really no need to replace them with dots.