Solved

Change file extension to txt

Posted on 2011-09-09
3
241 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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
Familiarize people with the process of utilizing SQL Server views from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Access…
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…

809 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