1

コマンドと比較している ID のリストが 2 つありますcomm。私の問題は、出力が次のようになることです。

YAL002W
YAL003W
        YAL004W
        YAL005C
                YAL008W
        YAL011W

All I want to do is try to pipe it somehow so the file is written with out the empty spcaces, that translate into white cell when I open this files in excel. I have tried every possible combination I have found of grep, awk and sed to remove blank spaces without luck...
So I have came to the conclusion that columns are separated by one or two tabs respectively, therefore I can not remove them as easily as removing blank spaces without removing the formating of the file.

any help or suggestion will be welcomed. Thanks

EDIT:

I want my output to be three columns, tab delimited without the blank spaces

YAL002W YAL004W YAL008W
YAL003W YAL005C
        YAL011W

EDIT2 to avoit XY Problem as referenced:

元の問題 (X): リストを作成する必要があり、両方のリスト間で共通の単語と一意の単語を見つけたい (後でベン図を生成するため)。comm3 つのリストを同時に取得し、後で簡単に Excel にインポートできるので、完璧なソリューションのように思えました。

二次的な問題 (Y): 生成される 3 つの列は 3 つの列ではありません (または、そう思い始めています) 。また、通常のorcut -fで空白を削除することもできません(たとえば)。awk 'NF'grep .

4

5 に答える 5