Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Read A File

Posted on 2002-07-15
5
Medium Priority
?
161 Views
Last Modified: 2010-05-02
I want to open a file called Monthend and read the first line, get that data and put it as the name of an output file with the .zip extension on it.  Can anyone help.
0
Comment
Question by:mtbuford
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 43

Accepted Solution

by:
TimCottee earned 200 total points
ID: 7154358
Dim intFHandle As Long
Dim strData As String
intFHandle = FreeFile()
Open "monthend" For Input As #intFHandle
Line Input #intFHandle,strData
Close #intFHandle
Msgbox strData & ".zip"
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 7154386
dim strLine as string

open "monthend" for input as #1
line input #1, strLine
close #1

strLine = strLine & ".zip"
open strLine for output as #1
...
close #1

CHeers
0
 
LVL 6

Expert Comment

by:ebosscher
ID: 7154440
TimCottees answer is more complete, as using freefile will prevent you from running into conflicts with the file number (1) being in use by another application.

Cheers
0
 
LVL 43

Expert Comment

by:TimCottee
ID: 7535977
Why a 'C' grade? A comment would have been nice!
0
 
LVL 6

Expert Comment

by:Mindphaser
ID: 7536958
Changed grade per request.

mtbuford

If you didn't get enough information feel free to ask the experts any further questions. Take a look at http://www.experts-exchange.com/jsp/cmtyQuestAnswer.jsp to read more about grading.

** Mindphaser - Community Support Moderator **
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Suggested Courses

704 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