Winn-Dixie Stores recorded a loss in its second quarter, hit by increased competition and the shift from branded to generic pharmaceutical products.