problem to read data in array

The statistic_program will accept the format like this (I think is quite similar to fasta format):

#read_1
1265460646046406
54546546546054654
564654646

The program just based on each "#" header to manipulate its relevant detail inside.

---------- Post updated at 07:07 AM ---------- Previous update was at 07:05 AM ----------

the script you suggested I named as "run_multi_sequence.sh". I do like this

chmod 755 run_multi_sequence.sh
./run_multi_sequence.sh

I got try to type the bash instead of "./" but both get the same error :frowning:

DATA=""
while read L
do
    if [ "${L:0:1}" = "#" ] 
    then
        echo -e "$DATA" # for check purpose
        [ -n $DATA ] && /statistic_program "$DATA"    # if there is data, process it (no data for the first occurence!)
        DATA=$L    # header, begin with a new set
    else
        DATA+="\n$L"    # \n:newline
    fi
done < input.txt
echo -e "$DATA" # for check purpose
/statistic_program "$DATA"    # process the last set

Really thanks for your help, frans :slight_smile:
I also not sure what is the problem about the code now :frowning:
It seems like the problem this times is happened at the line below :

DATA+="\n$L"

Thanks frans,
I try to edit some of your code.
Hopefully it is worked :slight_smile:
Thanks again ^^