С sed
ничего подобного нельзя сделать, это просто редактор текстового потока. Попробуйте этот сценарий Perl:
#!/usr/bin/env perl
## Set the record separator to \n\n to
## read multiple lines as a single record
$/="\n\n";
## This array will contain all lines of the file
my @lines=<>;
## The list of suffixes
@suffix=(a..z);
## For each line of the input file
foreach (@lines) {
## If the current line (lines are now the actual multiline records
## because we set $/ to consecutive newlines) is one we are interested in.
if (/isoforms.*?Target=(\S+)/s){
## Keep a list of seen targets
$seen{$1}++;
}
}
## Now that we have processed the entire file
## go back and print each line.
foreach (@lines) {
## If this line is one of the ones we're interested in
if(/Name=(.+?);.*?isoforms=.*?Target=(\S+)/s){
$name=$1; $target=$2;
## This is needed so we can know whether
## how many times we've seen this target so far.
$newseen{$target}++;
## If this target exists more than once in the input file
if ($seen{$target}>1) {
## Use the %newseen hash to choose the right letter.
## The -1 is needed because the first element of an
## array is 0, not 1.
s/$name/$target.$suffix[$newseen{$target}-1]/;
}
else {
s/$name/$target/;
}
}
print;
}
Сохраните приведенный выше сценарий как foo.pl
, сделайте его исполняемым ( chmod a + x foo.pl
) и запустите во входном файле:
./foo.pl input.txt > output.txt
Пусто (или неизвестно, если пространство используется неизвестным форматом)
Если вы имеете в виду белый бит справа от желтого бита на картинке? Это нереальная картина того, что происходит. Это просто столбчатая диаграмма того, сколько места используется в файловой системе -, а не где оно используется. Это файл -свободного места в системе. Он будет использоваться по мере добавления файлов в файловую систему -и увеличиваться при их удалении.
Если вы имеете в виду , а не , используемую файловой -системой (, я не вижу этого на картинке ), то это конфигурация с пропуском -. Файловые системы -должны заполнять раздел, но это не обязательно.