Solved

Change file extension to txt

Posted on 2011-09-09
3
221 Views
Last Modified: 2012-05-12
Hi guys,

I would like to write vb code that can change the file extension from .juz  to .txt and remove the first line in the .juz file so I can then import them into MS Access.

Thank you so much in advance.

0
Comment
Question by:Sheogorath
  • 2
3 Comments
 
LVL 21
ID: 36512782
Not a problem. It can be done easily.

I Let me put together some code. Be back shortly.
0
 
LVL 21

Accepted Solution

by:
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP earned 500 total points
ID: 36512807
Try this:

Dim FH As Integer
Dim FH2 As Integer

Dim strPath As String
Dim strPathOut As String
Dim strLineIn As String
Dim strLineOut As String


strPath = "c:\myfolder\myfile.juz"
strPathOut = "c:\myfolder\myfile.txt"


FH = FreeFile

Open strPath For Input As #FH

FH2 = FreeFile

Open strPathOut For Output As #FH2

' skip first line
  Line Input #FH, strLineIn


Do
   
  Line Input #FH, strLineIn
  ' coudl done any updates here
  strLineOut = strLineIn
  
  Print #FH2, strLineOut
   
Loop Until EOF(FH)

Close #FH
Close #FH2

Open in new window

0
 

Author Comment

by:Sheogorath
ID: 36512892
Thank you very much!!:)
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

762 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

26 Experts available now in Live!

Get 1:1 Help Now