Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 288
  • Last Modified:

Change file extension to txt

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
Sheogorath
Asked:
Sheogorath
  • 2
1 Solution
 
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPCommented:
Not a problem. It can be done easily.

I Let me put together some code. Be back shortly.
0
 
Boyd (HiTechCoach) Trimmell, Microsoft Access MVPCommented:
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
 
SheogorathAuthor Commented:
Thank you very much!!:)
0

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now