When extracting files, drop the hierarchical folder structure --strip-components
.
Only extract an specific element, just show the contents with -t
option and then add the component after the command.
# tar zxvf pack.tar.gz dir1/file.txt
# tar zxvf pack.tar.gz dir1/file.txt --strip-components=1