Liberty BASIC Community Forum
« unzipping file »

Welcome Guest. Please Login or Register.
Nov 17th, 2017, 8:48pm


Rules|Home|Help|Search|Recent Posts|Notification


« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: unzipping file  (Read 295 times)
Bob
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 5
xx unzipping file
« Thread started on: Sep 7th, 2017, 10:31pm »

Hello to all,

I am a novice programmer to just about everyone on here and new to this forum. I have used Liberty Basic off and on for over 10 years for the main purpose of writing, using and updating a horse racing handicapping program that I wrote. I learned basic way back in college and never had a good tutorial on using commands to unzip files, calls, dlls, etc. I am currently downloading zipped racing files from a website, unzipping them in winzip, opening the file in excel due to use of commas in the data (original unzipped date file is comma delimited but uses ""), renaming the file and then opening it with my program. I would like to expedite this process. Can anyone direct me to a good link that can teach me how to start the filedialog and open the zip file within my program?

Thank you
Bob
User IP Logged

robmcal
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 399
xx Re: unzipping file
« Reply #1 on: Sep 8th, 2017, 4:10pm »

7-zip has a command line version. You may try using that.
User IP Logged

Definition of an Upgrade: Take old bugs out, put new ones in.
Bob
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 5
xx Re: unzipping file
« Reply #2 on: Sep 8th, 2017, 10:19pm »

I have downloaded 7-zip but do not see any tutorials for programming.
User IP Logged

robmcal
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 399
xx Re: unzipping file
« Reply #3 on: Sep 8th, 2017, 10:34pm »

Not exactly sure how to use it myself. The command line syntax is described on this page.
https://sevenzip.osdn.jp/chm/cmdline/syntax.htm
User IP Logged

Definition of an Upgrade: Take old bugs out, put new ones in.
tenochtitlanuk
Moderator
ImageImageImageImageImage


member is offline

Avatar




Homepage PM

Gender: Male
Posts: 1169
xx Re: unzipping file
« Reply #4 on: Sep 9th, 2017, 2:02pm »

If you've downloaded 7za.exe to the directory holding your LB code, try the following which worked for me. Don't know what files are in your zip file nor what you'll do with them. If you KNOW filenames you can now parse them. If not you may need another filedialog to select a file....
There are examples about parsing csv files and delimiter problems around this forum and elsewhere.
Code:
    '   7za.exe extracts all files from *.zip to the current directory.

    nomainwin

    filedialog "Choose zip file", "*.zip", zipFile$

    run "7za.exe e " +zipFile$



 
User IP Logged

Bob
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 5
xx Re: unzipping file
« Reply #5 on: Sep 9th, 2017, 7:06pm »

Thank you tenochtitlanuk

This makes sense to open the zip file into the directory. I could then determine the filename selected as the zip file and unzip file have the same name and automatically select the unzipped file. I'll let you know how this turns out.

My next issue would be reprogramming how I have inputted the unzipped file. While the original unzipped file is comma delimited it does have quotes around the text data (ie "AQU",1,"Track",35). I currently change this file to a csv in excel and input data with simple character for comma to delimit the data. This would not work with the original unzipped file. Any suggestions for an easy correction to the programming code would be helpful.
User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5560
xx Re: unzipping file
« Reply #6 on: Sep 10th, 2017, 02:03am »

There is a new inputcsv command which you should experiment with.
User IP Logged

Bob
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 5
xx Re: unzipping file
« Reply #7 on: Sep 20th, 2017, 10:08pm »

I placed the 7zip file in my Liberty Basic directory and now I cannot access Liberty Basic. Any help would be appreciated. The icon shows on the tool bar but does not show the window, it appears to be in constant minimized stated.
User IP Logged

robmcal
Senior Member
ImageImageImageImage


member is offline

Avatar




PM

Gender: Male
Posts: 399
xx Re: unzipping file
« Reply #8 on: Sep 20th, 2017, 10:18pm »

http://libertybasic.conforums.com/index.cgi?board=general&action=display&num=1482348124
User IP Logged

Definition of an Upgrade: Take old bugs out, put new ones in.
Bob
New Member
Image


member is offline

Avatar




PM

Gender: Male
Posts: 5
xx Re: unzipping file
« Reply #9 on: Sep 21st, 2017, 8:50pm »

Thanks for link. I have found an alternate fix and will hope it continues to work. I created a shortcut for desktop for LibertyBasic directory. For some reason the recently used files link in Windows 10 was not accessing from this directory.
User IP Logged

Rod
Global Moderator
ImageImageImageImageImage


member is offline

Avatar

Graphics = goosebumps!


PM

Gender: Male
Posts: 5560
xx Re: unzipping file
« Reply #10 on: Sep 22nd, 2017, 01:40am »

Check the version number of Liberty BASIC displayed at top left of the IDE. You might have linked to an older version of Liberty. This will not have a corrupted .ini file and so will start and display normally.

If you have the corrupt .ini file problem we assumed you had it can ONLY be fixed by editing the .ini file or removing it and reinstalling a fresh version.

If you had Liberty open and displaying on the toolbar but no window visible then you do have a corrupted .ini file. This happens when you close Liberty whilst it is minimised, it is given silly window parameters by Windows which it remembers and so prevents the main IDE window opening, only the toolbar icon is displayed.

What version of Liberty do you have installed and do you still have older versions stored on disk? Liberty just creates a new directory and leaves old versions alone. So if you did not delete an older version it will still be on disk.
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

Rules|Home|Help|Search|Recent Posts|Notification

Donate $6.99 for 50,000 Ad-Free Pageviews!

| |

This forum powered for FREE by Conforums ©
Sign up for your own Free Message Board today!
Terms of Service | Privacy Policy | Conforums Support | Parental Controls