Yu, here is the other link
I went recently and found the city to be safe. Its like any big city so when you walk around, be careful of your personal items, especially in the touristy areas like Las Ramblas in Barcelona, and the Sol area in Madrid. Basically where there's a lot of crowds.
From Barcelona to Madrid the train is probably nicer but longer. I hate waiting so I took the plane, which departs every hour on iberia airlines, and it didn't cost much. Plus the flight took I think an hour??
Have a great time, and in Madrid, take a day trip to Segovia or Toledo. You can catch the bus early in the morning around 9 am, and be back in Madrid around 10 pm... just in time for dinner!
Check maribelsguide.com for helpful hints.