Questions tagged «for»

标记,用于表示与for循环有关的任何问题

1
从文本文件中的行访问子字符串并将其存储
我有一个这样的文本文件 chr1:16840617-16840780 RNU1-1 (2 columns are tab separated) chr3:142139047-142139211 RNU1-100P ............ ............ 我想遍历文本文件的行并将第1列和第2列保存在sep变量中,如下所示: OLDIFS=$IFS; IFS=$'\n'; for line in $(cat test.txt);do LOC="save location";NAME="save name";done 保存名称和位置后,我必须执行几个步骤才能获得所需的输出,但是到目前为止,我想存储它们。
1 linux  for 
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.