当前位置:网站首页>internal field separator
internal field separator
2022-07-01 22:46:00 【Yunmengtan】
Internal field separator (Internal Field Separator,IFS) yes shell An important concept in scripting . When processing text data , Often used .IFS In essence, it is a variable that holds the delimiter .
for instance , There is one CSV file , If you want to extract words , have access to IFS=" "; If you want to extract comma separated field values , You can use IFS="," .
extract CSV Fields in :
#!/bin/bash
data="Fist name, Last name, gender, rollno, location"
oldIFS=${IFS}
IFS=,
for item in ${data};
do
echo "Item : ${item}"
done
IFS=${oldIFS}
The operation results are as follows :
If you put IFS=, One line removed . So the default IFS Will be blank characters . The run result will change to :
边栏推荐
猜你喜欢
随机推荐
[ecological partner] Kunpeng system engineer training
黑马程序员-软件测试--06阶段2-linux和数据库-01-08第一章-linux操作系统阶段内容说明,linux命令基本格式以及常见形式的说明,操作系统的常见的分类,查看命令帮助信息方法,
记录一次spark on yarn 任务报错 Operation category READ is not supported in state standby
rxjs Observable of 操作符的单步调试分析
flink sql-client 使用 对照并熟悉官方文档
MySQL之MHA高可用配置及故障切换
小红书Scheme跳转到指定页面
Ida dynamic debugging apk
Slope compensation
互联网的智算架构设计
3DE 资源没东西或不对
人体姿态估计的热图变成坐标点的两种方案
并发编程系列之FutureTask源码学习笔记
Intelligent computing architecture design of Internet
完全注解的ssm框架搭建
Understanding of transactions in MySQL
IDA动态调试apk
Mysql database detailed learning tutorial
三翼鸟两周年:羽翼渐丰,腾飞指日可待
详解LockSupport的使用