Wangyw's picture
download
raw
1.55 kB
#!/bin/bash
REMOVE_ZIPS=false
# Parse command line arguments
while [[ $# -gt 0 ]]; do
case $1 in
--rm-zips|-rm)
REMOVE_ZIPS=true
shift
;;
--help|-h)
echo "Usage: $0 [OPTIONS]"
echo "Options:"
echo " --rm-zips, -rm Remove zip files after extraction (default: keep them)"
echo " --help, -h Show this help message"
exit 0
;;
*)
echo "Unknown option: $1"
echo "Use --help for usage information"
exit 1
;;
esac
done
# Extract point clouds
CHUNK_COUNT=$(ls pcd/chunk_*.zip 2>/dev/null | wc -l)
if [ "$CHUNK_COUNT" -eq 0 ]; then
echo "No chunk zip files found in pcd folder!"
exit 1
fi
# Extract point clouds
for i in $(seq 0 $((CHUNK_COUNT-1))); do
chunk_num=$(printf "%03d" $i)
echo "Extracting chunk $chunk_num"
unzip -j pcd/chunk_$chunk_num.zip -d pcd/
unzip -j layout/chunk_$chunk_num.zip -d layout/
done
echo ""
echo "All point clouds and layouts extracted!"
# Interactive prompt to remove zip files
if [ "$REMOVE_ZIPS" = false ]; then
echo ""
read -p "Do you want to remove the zip files? (Y/N): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
REMOVE_ZIPS=true
fi
fi
# Remove zip files if requested
if [ "$REMOVE_ZIPS" = true ]; then
echo "Removing zip files..."
rm -f pcd/chunk_*.zip
rm -f layout/chunk_*.zip
echo "Zip files removed!"
else
echo "Zip files kept."
fi

Xet Storage Details

Size:
1.55 kB
·
Xet hash:
1df6852e20d6870b2d24337e1d359e749e11e76f995910ae44dab727be252b48

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.