Solved

3 lines in one

Posted on 2001-06-27
5
124 Views
Last Modified: 2010-05-02
i have a text file
c:\Bob\log.txt
it has info on 3 lines that i need in a new text file,with the 3 lines combined, then loop thru the whole text file and combine
 
bob
fred
stan
mel
ralph
pete

bob fred stan
mel ralph pete
0
Comment
Question by:underground712
  • 3
5 Comments
 
LVL 43

Expert Comment

by:TimCottee
Comment Utility
Open "MyFile1" For Input As #1
Open "MyFile2" For Output As #2
Do
  Input Line #1,strLine1
  Input Line #1,strLine2
  Input Line #1,strLine3
  Print #2,strLine1 & " " & strLine2 & " " & strLine3
Loop Until Eof(1)
Close #1
Close #2
0
 
LVL 43

Expert Comment

by:TimCottee
Comment Utility
Sorry that should be:

Open "MyFile1" For Input As #1
Open "MyFile2" For Output As #2
Do
 Line Input #1,strLine1
 Line Input #1,strLine2
 Line Input #1,strLine3
 Print #2,strLine1 & " " & strLine2 & " " & strLine3
Loop Until Eof(1)
Close #1
Close #2
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 50 total points
Comment Utility
Sorry that should be:

Open "MyFile1" For Input As #1
Open "MyFile2" For Output As #2
Do
 Line Input #1,strLine1
 Line Input #1,strLine2
 Line Input #1,strLine3
 Print #2,strLine1 & " " & strLine2 & " " & strLine3
Loop Until Eof(1)
Close #1
Close #2
0
 
LVL 18

Expert Comment

by:deighton
Comment Utility
Open "MyFile1" For Input As #1
Open "MyFile2" For Output As #2
Do Until Eof(1)
Line Input #1,strLine1
Line Input #1,strLine2
Line Input #1,strLine3
Print #2,strLine1 & " " & strLine2 & " " & strLine3
Loop
Close #1
Close #2
0
 
LVL 1

Expert Comment

by:eosu
Comment Utility
Sorry - not clear on the question - you want every 3 lines merged into 1? or just the first 3, in which case what do you want done with the remaining lines?
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

6 Experts available now in Live!

Get 1:1 Help Now