I'm using the following command to lowercase all characters in a text file.
CORPUSLOWER=$(cat foobar.txt | tr '[:upper:]' '[:lower:]')
echo $CORPUSLOWER > foobar.txt
The problem, however, is that foobar.txt
is about 20gig big and it only replaces a small chunk of the foobar.txt
file.
My question: how can I use bash to convert a large file to lowercase?