Formatting help needed awk or sed maybe

I am executing the following command:

sort file1.txt | uniq -c | sort -n > file2.txt

The problem is that in file 2, I get leading spaces, Like so:

      1 N/A|A8MW11
      8 N/A|ufwo1
      9 N/A|a8mw11
     10 900003|smoketest297688
     10 N/A|a9dg4
     10 danny|danni
     12 900003|ufwo12
     12 N/A|a9po1
    106 00001|a8ar8

The whitespace after the first numbers are ok, because I will change that to a pipe, but is there a way to get rid of the leading white spaces first? Or is my command flawed?

sort file1.txt | uniq -c | sort -n | perl -pe 's/^\s+//' > file2.txt
sort file1.txt | uniq -c | sort -n | awk '$1=$1' > file2.txt
awk '{a[$0]++}END {for (i in a) print a, i |"sort -n"}' file1.txt > file2.txt
sort file1.txt | uniq -c | sort -n | sed 's/^[ ]*//' > file2.txt

Here is the solution that I used:

sort file1.txt | uniq -c | sort -n | sed 's/^[ ]*//' > file2.txt

Thanks all