Solved

Read A File

Posted on 2002-07-15
5
160 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 50 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month5 days, 14 hours left to enroll

627 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