vbscript - Scanning multiple CSV files to append a single output file -
starting code:
const forreading = 1 const forappending = 8 set objfso = createobject("scripting.filesystemobject") set objsourcefile = objfso.opentextfile("path\file.csv", forreading) set objdestinationfile = objfso.opentextfile("path\database.csv", forappending) 'loop start files in dir until objsourcefile.atendofstream strline = objsourcefile.readline arrfields = split(strline, ",") if arrfields(0) <> """""" strcontents = strcontents & arrfields(1) & "," end if loop strcontents = strcontents & vbcrlf objsourcefile.close objdestinationfile.write strcontents 'move source file processed directory 'loop end files in dir objdestinationfile.close which fine 1 file @ time, i'm trying append many files single file.
appreciate tips.
thanks.
edit: request started single file turned having migrate many files. original csv needed have format changed , placed easier use csv. issue there many files , each source file has modified before placing destination file. new vb scripting , trying concise text. thanks. appreciate help.
Comments
Post a Comment