Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
(Solved).....................joining together .txt files
#1

I have about 500 .txt files in a folder ($desktop$\Running times\) I want to join all those files into one .txt file and save it to the c drive.... how would I do this?

P.S and maybe put the name of the file as like a header in the new file.

EX.....

File name.txt
......................
Body of file


......................

File name.txt
......................
Body of file


......................

Thank you



Edit......... Solved.



Code:
Copy      Help
int flags
Dir d; str sFn sBn NewS NewF

NewS=
;.............
;%s
;.............
;%s

foreach(d "$desktop$\New Folder\*.txt" FE_Dir flags&15)
,sFn="";sFn=d.FileName(0)
,sBn="";sBn.getfile(d.FileName(1))
,
,NewF.formata(NewS sFn sBn)
NewF.setfile("C:\NewJoined.txt")


Forum Jump:


Users browsing this thread: 1 Guest(s)