Can this be done more easily in a single command?
Read line 10 and column 2 from the file where the separator is ^
cat file | awk 'FNR==10 {print}' | awk -v FS=^ '{print $2}'
如果^
是所有记录的主/公用字段分隔符-只需应用以下awk表达式就足够了:
awk -F'^' 'NR==10{ print $2; exit }' file
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.