Solved

Change file extension to txt

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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

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

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…
QuickBooks® has a great invoice interface that we were happy with for a while but that changed in 2001 through no fault of Intuit®. Our industry's unit names are dictated by RUS: the Rural Utilities Services division of USDA. Contracts contain un…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

895 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

14 Experts available now in Live!

Get 1:1 Help Now