|
|
|||||||||
|
|||||||||
|
|||||||||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
Hi there
can you please help me with the vb code that will open 2 textfiles and save the data into the third one.the first file contains the agentcode and the second one contains the 12 products.Each agentcode must be given the 12 products and save the results into the third one. AGENTCODESAQ/01/000 AQ/01/001 AQ/01/002 AQ/01/003 AQ/01/004 AQ/01/005 AQ/01/006 AQ/01/007 AQ/01/008 AQ/01/009 AQ/01/010 THE PRODUCTS FILE ALE 12 15 16 20 GAP 50 25 70 50 GRO 55 60 70 90 HPP 120 150 120 100 HVP 55 80 75 63 MBB 83 60 75 20 MFB 66 55 99 100 PRO 78 100 89 45 RFM 200 300 555 990 RHP 88 450 44 566 RPG 60 70 88 755 RPV 66 90 78 63 THE RESULTS MUST LOOK LIKE THIS(with all the agents code) Agent Code Prod AQ/01/000 ALE 12 15 16 20 AQ/01/000 GAP 50 25 70 50 AQ/01/000 GRO 55 60 70 90 AQ/01/000 HPP 120 150 120 100 AQ/01/000 HVP 55 80 75 63 AQ/01/000 MBB 83 60 75 20 AQ/01/000 MFB 66 55 99 100 AQ/01/000 PRO 78 100 89 45 AQ/01/000 RFM 200 300 555 990 AQ/01/000 RHP 88 450 44 566 AQ/01/000 RPG 60 70 88 755 AQ/01/000 RPV 66 90 78 63 AQ/01/001 ALE 12 15 16 20 AQ/01/001 GAP 50 25 70 50 AQ/01/001 GRO 55 60 70 90 AQ/01/001 HPP 120 150 120 100 AQ/01/001 HVP 55 80 75 63 AQ/01/001 MBB 83 60 75 20 AQ/01/001 MFB 66 55 99 100 AQ/01/001 PRO 78 100 89 45 AQ/01/001 RFM 200 300 555 990 AQ/01/001 RHP 88 450 44 566 AQ/01/001 RPG 60 70 88 755 AQ/01/001 RPV 66 90 78 63 I'VE TRIED THE DO WHILE LOOP BUT I DON'T GET THE RESULT THAT I'M LOOKING FOR Set f = fso.OpenTextFile(path, ForReading) Dim line As StringA Dim final_file As String Dim sh_string As String Dim file As String Dim file_final As String file_final = text_write.Caption line = "a" Do While line <> "" line = f.ReadLine Open file_final For Input As #2 file = "a" Do While file <> "" file = f.ReadLine Line Input #2, inputdata file = inputdata & vbCrLf final_file = line & Space(5) & file str = "" show_string = show_string & final_file & vbCrLf '************************** final_file = "" Loop Loop MsgBox show_string Call write_2_file(show_string) |
|
#2
|
|||
|
|||
|
Have you stepped through your code with the debugger?
__________________
====== Doug G ====== I didn't attend the funeral, but I sent a nice letter saying I approved of it. --Mark Twain |
![]() |
| Viewing: ASP Free Forums > Programming > Visual Basic Programming > Manipulating to 2text files into a resulting text file(vb) |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
![]() |
|