处理由几个 CSV 的串联产生的 csv,我正在寻找删除标题行重复的可能性(存在于每个串联的 CSV 中,它们之间是相同的)。这是我的 CSV 包含重复的第一行:
ID(Prot), ID(lig), ID(cluster), dG(rescored), dG(before), POP(before)
1000, lig40, 1, 0.805136, -5.5200, 79
1000, lig868, 1, 0.933209, -5.6100, 42
1000, lig278, 1, 0.933689, -5.7600, 40
1000, lig619, 3, 0.946354, -7.6100, 20
1000, lig211, 1, 0.960048, -5.2800, 39
1000, lig40, 2, 0.971051, -4.9900, 40
1000, lig868, 3, 0.986384, -5.5000, 29
1000, lig12, 3, 0.988506, -6.7100, 16
1000, lig800, 16, 0.995574, -4.5300, 40
1000, lig800, 1, 0.999935, -5.7900, 22
1000, lig619, 1, 1.00876, -7.9000, 3 …
Run Code Online (Sandbox Code Playgroud) 我有一个由 240 个浮点数组成的日志文件,格式如下:
5.4
5.1
5.2
5.4
5.4
4.9
5.0
5.2
5.5
5.3
5.6
5.4
5.1
5.3
5.3
5.1
5.2
..
4.8
Run Code Online (Sandbox Code Playgroud)
在 bash 环境中访问此日志文件,我需要计算此数据的平均值(元素的总和除以元素数),然后将结果值存储为我将在同一个 bash 中使用的新变量出于某些目的编写脚本,例如我需要存储一个变量 mean = 5.0 是否可以直接在一个 bash 脚本中执行此操作?
我有一个按以下格式排列的日志文件:
# This file was created Thu Dec 17 16:01:26 2020
# Created by:
# :-) GROMACS - gmx gyrate, 2019.3 (-:
#
# Executable: /usr/local/bin/../Cellar/gromacs/2019.3/bin/gmx
# Data prefix: /usr/local/bin/../Cellar/gromacs/2019.3
# Working dir: /Users/gleb/Desktop/DO/unity_or_separation
# Command line:
# gmx gyrate -f /Users/gleb/Desktop/DO/unity_or_separation/storage/7000_cne_lig177/1AllBoxes_7000_cne_lig177.xtc -s /Users/gleb/Desktop/DO/unity_or_separation/storage/7000_cne_lig177/lig_1AllBoxes_7000_cne_lig177.pdb -o /Users/gleb/Desktop/DO/unity_or_separation/storage/7000_cne_lig177/RG/RG_1AllBoxes_7000_cne_lig177.xvg
# gmx gyrate is part of G R O M A C S:
#
# God Rules Over Mankind, Animals, Cosmos and Such
#
@ title "Radius of gyration (total and around axes)"
@ …
Run Code Online (Sandbox Code Playgroud)