excel - How to remove a linebreak in a text file VBScript -


i have numerous csv files , don't import correctly excel, im asking there way remove line breaks @ end of strline using vbscript?

yes, can remove line breaks csvs. readline automatically remove line breaks end of line:

set fso = createobject("scripting.filesystemobject")  filename = "c:\path\to\your.csv"  f1 = fso.opentextfile(filename) f2 = fso.opentextfile(filename & ".tmp", 2, true) until f1.atendofstream   f2.write f1.readline loop f1.close f2.close 

or read whole file , replace line breaks:

set fso = createobject("scripting.filesystemobject")  filename = "c:\path\to\your.csv"  text = fso.opentextfile(filename).readall fso.opentextfile(filename, 2).write replace(text, vbnewline, ",") 

however, might addressing symptom rather cause. second ekkehard.horner's comment: better answer should provide more details input file , way import fails.


Comments

Popular posts from this blog

user interface - Python attempting to create a simple gui, getting "AttributeError: 'MainMenu' object has no attribute 'intro_screen'" -

jquery - Common JavaScript snippet to share files on Google Drive, Dropbox, Box.net or SkyDrive -

Android Gson.fromJson error -