Ask Your Question
0

I have a PDF file broken up and extracted in many different packets how can I reassemble and restore the file?

asked 2023-04-14 23:23:44 +0000

snap gravatar image

There are ~900 packets when I go to export objects through HTTP, I can download but they cannot be viewed and I am unsure how to reassemble the file to its proper state.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-04-20 07:41:04 +0000

pippuzzo gravatar image

As the "splittig" procedure does not add extra characters nor remove any of them, to reassemble the packets is sufficient to join the packets in the original order, and I assume they have been numbered sequentially.
To do that, any method capable of joining packets is good.
You can use a Ms-Dos command (copy /b file1+file2+.....+fileN Output.pdf), or a public domain tool like WGet (wget -i list.txt -O output.pdf), where in list.txt you put the names of all the files to assemble, just use the straight slash, or even an Excel Vba program, as in the following example:
const prefix="seg-"
const suffix=".ts"
const fileout="output.pdf"
dim i as integer
dim s as string
open fileout for binary as 1
for i=1 to 900
open prefix & i & suffix for binary as 2
s = Input(LOF(2), 2)
put 1,,s
close 2
next
close #1
Obviously, you have to fine tune the names to your situation, specially to account for the numeric part of the packet name, if it is fixed length or variable length.
I hope this helps.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2023-04-14 23:23:44 +0000

Seen: 325 times

Last updated: Apr 20 '23