我正在尝试将数据导入postgres。数据字段是逗号分隔的,字符串可能包含逗号,在这种情况下,这些逗号是转义的:
数据结构:
create table v (a varchar);
数据文件:
bus
'Gat\,\\e\'way_MQB'
导入命令(在Linux下从bash运行)
cat data.csv | psql -d database -c "copy v (a) from stdin with delimiter ',' escape '\\' CSV header"
错误:
ERROR: extra dat
我想从文件中提取不包含特定模式的所有行。
pattern="tmp/[...]/include/linux/*.h"
file contains:
17937;/home/[...]/tmp/[...]/include/linux/header.h;484;16;[Other text here]
37417;/home/[...]/tmp/[...]/src/file.cpp;1851;41;[Other text here]
17945;/home/[...]/tmp/[...]/include/linux/*/header.h;484;16;[Other text her