首页 \ 问答 \ awk命令:如何告诉它区分空格和制表符分隔符(awk command: how to tell it to distinguish between space and tab delimiter)

awk命令:如何告诉它区分空格和制表符分隔符(awk command: how to tell it to distinguish between space and tab delimiter)

我使用这个命令, awk '{print $1}' "$line" ,从一个看起来像这样的文件中获取一列数据:(下划线表示制表符作为分隔符,例如是三列数据)

Joe Jonas_____8_____45  
Cersei Lann_____4_____23  
Bo Tox_____6_____28  
Mis Ter Yo_____7_____89  

当我运行命令时,说要获取第一列,但输出显示如下:

Joe  
Cersei  
Bo  
Mis  

如何使命令忽略第一列数据中的空格?


I used this command, awk '{print $1}' "$line", to get a column of data from a file that looks like this:(underscores represent tab as a delimiter, example is a three-column data)

Joe Jonas_____8_____45  
Cersei Lann_____4_____23  
Bo Tox_____6_____28  
Mis Ter Yo_____7_____89  

When I run the command, say to get the first column, the output, however, showed it like this:

Joe  
Cersei  
Bo  
Mis  

How can I make the command to ignore the spaces within the data of the first column?


原文:https://stackoverflow.com/questions/38473781
更新时间:2024-02-21 14:02

最满意答案

要使模态起作用,您应该包括:

  • jQuery的
  • 引导-min.js

Bootstrap使用模态中的自定义属性来查找和应用javascript功能。 您不需要自己编写绑定。


To get the modal to work you should include:

  • jquery
  • bootstrap-min.js

Bootstrap uses the custom attributes in the modal to find and apply the javascript functionality. You do not need to write the binding yourself.

相关问答

更多
  • 只需在您的文档头部的jQuery load事件中打包要在页面加载中调用的模态,并且弹出如下所示: JS HTML
  • 利用元素iframe