I am merging many files (~1 gig each) into one file but the merged file is incomplete. when concatenating b to a, b gets concatenated somewhere in the middle rather than end. The command I am running are:
for f in $x/*/y/*.fastq; do
fullpath=`echo $(readlink -f $f)`
basename=`echo "${fullpath##*/}"`
pathname=`echo "${fullpath%/*}"`
name=`echo "$basename"|sed 's/-_-.*//'`
cat $f>>$x/z/${name}.fastq
done
also, alternatively
names=$(cut -f 3 $B)
names=$(echo "${names[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ')
for name in ${names[@]}; do
cat $x/*/y/${name}-_-*.fastq>$x/z/${name}.fastq
done
after I inspect the file, the merged file has smaller size than original and also concatenated somewhere in middle.
Thanks