我看過這篇文章:sed delete remaining characters in line except first 5它幫助我刪除x後的所有字符。但是,我很難找到如何刪除x字符後的所有單詞。 我開始使用此代碼: echo "StackOverflow Users Are Brilliant And Hard Working" | sed 's/.//30g'
#character 30 -
在Unix領域相當新穎,我目前正試圖從文本文件中提取數據集。我嘗試過使用sed,grep,awk,但它似乎只能用於提取行,但我想提取整個數據集...以下是我想從中提取2個數據集的文件示例「時間強度」線) [Header]
Application Name LabSolutions
Version 5.87
Data File Name C:\LabSolutions\Data\Antoine
我試圖合併關於每個柱交替行 輸入: ind1 T G T
T T T
ind2 G G T
G T T
期望輸出: ind1 TT GT TT
ind2 GG GT TT
我試圖這些命令: sed 'N;s/\n/ /' <input> output
和 paste - - <input> output
但它只合並交替行,但加入整行,不考慮列;例如: ind