Merge multiple text files into one text file

Dec 26 2013 4:47 AM
I have multiple text files .each file is named as s100041.asd.txt ,s100044.asd.txt ....... . Now each file contain   two fields such as
 
Wavelength   S100141.asd
325    0.015082292401682
326    0.011690540571175
327   1.06575414031349E-02
328   1.30298010496599E-02
329   0.014743817273513
 
 
another file 
 
Wavelength S100144.asd
325  1.35059549289737E-02
326  0.010981114226419
327  1.22348778870862E-02
328  1.63555124470031E-02
329  1.57389782659161E-02
 
 likewise i have lot of files in which wavelength is common and only  .asd field differ.
 
I want  to put one opendialog control through which I can select multiple files. as I select files all those files get  combined and result in one txt file and  output appears like this
 
 
 
 
S100144.asd S100143.asd S100142.asd S100141.asd
0.013506 0.016867 0.011569 0.015082
0.010981 0.015599 0.009434 0.011691
0.012235 0.015259 0.010794 0.010658
0.016356 0.016275 0.014576 0.013030
0.015739 0.016134 0.013878 0.014744
0.014514 0.016259 0.012032 0.015209
0.015142 0.017304 0.011341 0.014354
0.015259 0.017318 0.012004 0.014129
0.014385 0.016048 0.012976 0.013645
0.012086 0.013314 0.012666 0.011062
0.012186 0.013723 0.012504 0.011287
0.014508 0.016509 0.012791 0.013942
0.015285 0.015257 0.013379 0.013823
0.014972 0.013261 0.013592 0.012550
0.014264 0.012519 0.013243 0.011364
0.016256 0.013304 0.013790 0.012205
0.018061 0.014753 0.014364 0.013313
0.015868 0.015758 0.013750 0.012321
0.014737 0.015407 0.013885 0.012425
0.014850 0.014171 0.014401 0.013287
 
 
 
i'm new to c# please  i need code for it .......
 

Answers (14)