File size: 1,223 Bytes
d431f60
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!/bin/bash

# Merge script for structured3d dataset
# This script reassembles chunks back into the original structured3d.tar.gz file

DATASET_NAME="structured3d"
OUTPUT_FILE="structured3d.tar.gz"

echo "Merging $DATASET_NAME chunks"
echo "============================="

if [ ! -d "chunks" ]; then
    echo "Error: chunks directory not found"
    echo "Run ./split.sh first or ./download.py to get chunks"
    exit 1
fi

# Check if chunks exist
if [ ! -f "chunks/${DATASET_NAME}_part_000" ]; then
    echo "Error: No chunks found in chunks directory"
    echo "Expected files like ${DATASET_NAME}_part_000, ${DATASET_NAME}_part_001, etc."
    exit 1
fi

echo "Found chunks:"
ls -lh chunks/${DATASET_NAME}_part_* | awk '{print "  " $9 ": " $5}'

echo
echo "Reassembling $OUTPUT_FILE..."

# Merge chunks in correct order
cat chunks/${DATASET_NAME}_part_* > "$OUTPUT_FILE"

if [ $? -eq 0 ]; then
    echo "✓ Successfully reassembled $OUTPUT_FILE"
    echo "File size: $(ls -lh "$OUTPUT_FILE" | awk '{print $5}')"
    
    echo
    echo "Next steps:"
    echo "1. Run ./extract.sh to extract the contents"
    echo "2. Verify the file integrity if needed"
else
    echo "✗ Failed to reassemble $OUTPUT_FILE"
    exit 1
fi