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

x
?
Solved

Change file extension to txt

Posted on 2011-09-09
3
Medium Priority
?
279 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
[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
  • 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 2000 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

As tax season makes its return, so does the increase in cyber crime and tax refund phishing that comes with it
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

715 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