LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-20-2023, 05:31 PM   #1
GeordieJedi
LQ Newbie
 
Registered: Jan 2008
Posts: 26

Rep: Reputation: 2
Question Extracting files from Amiga disk magazine > Script needed >


Hi there guys.

I was hoping that you could help me with an obscure problem that I'm trying to solve.


Background:
Like a lot of people my age, I grew up with, and love the Amiga range of computers.
(Linux is the closest feeling I get to using an Amiga these days).

(For those who may be unaware BITD, before we had the internet) we used disk magazines
to store/distribute and display data and articles on floppy disks.

One of these was called Grapevine and it was one of the best diskmags ever made.

Myself and others are trying to convert these articles back into plain text / PDFs
So that they can be read much easier and without having to run an emulator.

However they were crunched down with Amiga archiving software called Powerpacker,
and then altered slightly to hide this, and obfuscate the archiving mechanism.
(So I can't just use Powerpacker on an Amiga emulator to recreate the files).


Issue:
I'm trying to -
2.1. Scan these files and strip out the individual articles.

2.2. Unpack /(de-crunch) some files.

I believe that once I have been able to extract the articles from the files
I will be able to put them into Powerpacker on the Amiga emulator,
unpack the files, then save each article individually.


Troubleshooting:
I have tried the following -

1. OCR using OCR reader = Terrible results.

2. OCR using gscan2pdf = Reasonable results. However you still need to do a lot of manual
clean up on each of the text files.

This would constitute a massive amount of work for the thousands of articles
that are in the complete set of Grapevine disks.

3. Looked at the files in a HEX editor

One of the guys on the EAB Amiga Forum has taken a look using a hex editor
and noticed the following details about the article files

Code:
$2 *bytes - Number of articles

[repeat for each article]
$2c bytes - Article title
$4 *bytes - Article offset in file
$4 *bytes - Article file size

rest.. *data files packed with powerpack with PP20 replaced with TXT!
He has also very kindly -

4.1. Created a Windows script/console app to do this (created using C#).
4.2. Provided the source code for this script/app (see attachment).

As a result I then tried -
5. Using the Windows console app but using -
5.1. A 32-Bit Wineprefix
5.2. A 32-bit Play on Linux install

Neither of which worked.


Questions:
Can you help create a bash script that would -

1.1. Scan the grapevine articles files.
1.2. Split out the articles from the file.
1.3. Change the header from TXT! back to PP (to denote that it's a powerpack file)

This should allow me to then use powerpacker to save each text file individually
so that we can obtain the separate text files, once again.

I was hoping that providing the source code would make this a whole lot easier
for the programmers amongst you.


Useful extra details:

Source code - For the Windows CLI/app (above)
Stored as a .txt file

I had tried to also upload the Windows console/app
and an actual Grapevine bin file containing the archived articles
however the upload system would not recognize them as valid files

And I didn't want to rename them in the hopes that it would
pass the filter.



A MASSIVE TIA - for any help or advice.
Attached Files
File Type: txt gv_extractor_source_c_sharp.txt (1.2 KB, 4 views)
 
Old 11-21-2023, 12:12 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,372

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Have you seen this page?
The Ancient project on GitHub appears to be active.
 
1 members found this post helpful.
Old 11-30-2023, 03:44 PM   #3
GeordieJedi
LQ Newbie
 
Registered: Jan 2008
Posts: 26

Original Poster
Rep: Reputation: 2
@allend

Thanks for your link, it was very interesting.
And had some cool Amiga and Linux tools on there.

I did eventually get the Windows app to compile in Linux (using mono)
with a little help from some members on another forum

I was then able to scan the files, and extract the basic individual files from the
Amiga Grapevine bin file.

Now I just need to try and script the unpacking, converting to ASCII
and possibly even removing some ASCII control codes from the basic text.

But thanks again for your help and suggestions.
 
1 members found this post helpful.
Old 12-08-2023, 02:12 PM   #4
GeordieJedi
LQ Newbie
 
Registered: Jan 2008
Posts: 26

Original Poster
Rep: Reputation: 2
Using ancient worked perfectly (even if the syntax is a bit weird).

So the next step is to knock together a basic bash script to automate this
whole process.

What I'd like to do is -

Scan a dir, (containing multiple of these separate and differently named powerpacked files).
Then either -

1. Use ancient to unpack the compressed Amiga data file (extension = .pp20)

1.1. Unpack it into the same dir, but have the output file named the same as
the original, but add .txt to the end of the output file.

Or

2. Use ancient to unpack the compressed Amiga data file (extension = .pp20)

2.1. Unpack the output file into a different dir, and again add .txt to the end
of each output file.

How would I go about doing this please ?
 
1 members found this post helpful.
Old 12-09-2023, 06:06 AM   #5
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,372

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Quote:
Using ancient worked perfectly (even if the syntax is a bit weird).
I am not familiar with ancient, so an example of usage would help.

As a start to a bash script, perhaps a simple loop construction would suffice.
Code:
#!/bin/bash

topdir=$HOME/temp  # Top directory to search
destdir=/tmp  # Destination directory for files to be moved into
shopt -s globstar  # Allow recursion into subdirectories

cd $topdir
for f in **/*.pp20; do
  # Your ancient command here
  # Append .txt to output filename in $f here
  # mv "$f.txt" "$destdir"
done
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Old SCSI (Amiga) disk not seen mcnalu Slackware 6 04-29-2018 03:06 AM
LXer: Dragonia Magazine: new online magazine for Linux users LXer Syndicated Linux News 4 07-12-2009 03:14 PM
LXer: Linux Magazine is dead. Long live Linux Magazine! LXer Syndicated Linux News 0 06-24-2008 07:10 AM
Amiga Emulator X11 Linux - General 2 04-09-2002 05:15 AM
About amiga format to linux format? 45pferde Linux - General 0 08-12-2001 07:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:31 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration