商务合作:179001057@qq.com

bash读取txt文件, 并在浏览器中以表格形式输出

xiaoxiao2021-09-23  46

例如文本 data.txt

1 201623210021 wangzhiguo 25 2 201623210022 yangjiangbo 26 3 201623210023 yangzhen 24 4 201623210024 wangdong 23 5 201623210025 songdong 25 #!/bin/bash echo HTTP/1.0 200 OK echo Content-type: text/html echo "<html>" ..... echo "</head><body>" echo "<table>" cat data.txt | while read index number name age do echo "<tr>" echo "<td>${index}</td>" echo "<td>${number}</td>" echo "<td>${name}</td>" echo "<td>${age}</td>" echo " <tr>" done echo "</table>"

awk : https://www.cnblogs.com/ggjucheng/archive/2013/01/13/2858470.html wc: http://www.cnblogs.com/peida/archive/2012/12/18/2822758.html 读取文件的每一行内容并输出: https://www.cnblogs.com/iloveyoucc/archive/2012/07/10/2585529.html

商务合作:179001057@qq.com

CopyRight © 2010-至今 All Rights Reserved
Processed: 0.017, SQL: 9