我参考了stackoverflow中所有此问题的以往回答并尝试了以下方法。但不幸的是,我仍然遇到了问题。
我有一个名为
提取结果会在数据目录下生成两个文件夹:
我尝试了以下操作,但出现了如下错误。
我有一个名为
Rels_obs
的文本文件,它位于目录home/manuela/PycharmProjects/knowledgegraphidentification/data
中。随着脚本的运行,它会提取一个被压缩的kgis.tar.gz
文件夹,并以以下方式进行解压缩。#!/bin/bash
readonly DATA_URL='https://linqs-data.soe.ucsc.edu/public/psl-examples-data/kgi.tar.gz'
readonly DATA_FILE='kgis.tar.gz'
readonly DATA_DIR='kgi'
function main() {
trap exit SIGINT
check_requirements
fetch_file "${DATA_URL}" "${DATA_FILE}" 'data'
extract_tar "${DATA_FILE}" "${DATA_DIR}" 'data'
}
提取结果会在数据目录下生成两个文件夹:
home/manuela/PycharmProjects/knowledgegraphidentification/data
。
- eval directory :
home/manuela/PycharmProjects/knowledgegraphidentification/data/kgi/eval
- learn directory :
home/manuela/PycharmProjects/knowledgegraphidentification/data/kgi/learn
Rels_obs
文件复制到这两个新建的目录:eval
和learn
。我尝试了以下操作,但出现了如下错误。
#!/bin/bash
readonly DATA_URL='https://linqs-data.soe.ucsc.edu/public/psl-examples-data/kgi.tar.gz'
readonly DATA_FILE='kgis.tar.gz'
readonly DATA_DIR='kgi'
function main() {
trap exit SIGINT
check_requirements
fetch_file "${DATA_URL}" "${DATA_FILE}" 'data'
extract_tar "${DATA_FILE}" "${DATA_DIR}" 'data'
echo "COPYING"
//I have only one file that is of plain text format within the data directory
for file in ~/PycharmProjects/knowledgegraphidentification/data/*.txt
do
name="$(basename "$file" .txt)"
cp "$file" "~/PycharmProjects/knowledgegraphidentification/data/kgi/eval"
cp "$file" "~/PycharmProjects/knowledgegraphidentification/data/kgi/learn"
done
echo "SUCCESSFULLY COPIED FILES"
}
错误
COPYING cp:无法查找“/home/manuelanayantarajeyaraj/PycharmProjects/knowledgegraphidentification/data/.txt”:没有那个文件或目录 cp:无法查找“/home/manuelanayantarajeyaraj/PycharmProjects/knowledgegraphidentification/data/.txt”:没有那个文件或目录
在数据目录上进行ls -l操作
total 20524
-rwxr-xr-x 1 manuelanayantarajeyaraj manuelanayantarajeyaraj 2210
Feb 5 15:19 fetchData.sh
drwxrwxr-x 4 manuelanayantarajeyaraj manuelanayantarajeyaraj 4096
Nov 19 2017 kgi
-rw-rw-r-- 1 manuelanayantarajeyaraj manuelanayantarajeyaraj 18546351
Feb 5 15:21 kgis.tar.gz
-rw-rw-r-- 1 manuelanayantarajeyaraj manuelanayantarajeyaraj 2459319
Feb 5 13:31 Rels_obs
如果您在这方面有任何建议,我们将不胜感激。
ls -l ~/PycharmProjects/knowledgegraphidentification/data//Rels_obs.txt ; file ~/PycharmProjects/knowledgegraphidentification/data//Rels_obs.txt
?(如果你已经将其重命名,请不要包含.txt扩展名) - jvdmrcp:无法统计'home / manuelanayantarajeyaraj / PycharmProjects / knowledgegraphidentification / data / Rels_obs':没有那个文件或目录
。我已经更新了我的问题,附上了ls -l输出。 - Nayantara Jeyaraj