There are several trains per day (including overnight hotel trains) from other parts of Europe (via France) and they are regular & reliable.
Main train stations:
Barcelona-Sants (to the south west of the center).
Barcelona-Passeig de Gràcia (near Carrer d’Aragó on Passeig de Gràcia, in the center of the city).
Barcelona-Estació de França, Avinguda Marquès de l´Argentera (on the edge of the old town next to the seafront district of Barceloneta).
From Estació de Sants and Passeig de Grácia there are several connections per day to Cerbère (France), connecting there on trains towards Marseille and Nice. There are also 1-2 direct “Talgo” trains a day from Sants to Perpignan, Beziers, Narbonne and Montpellier in France.
Overnight Trenhotel trains operated by Elipsos run daily from Paris-Austerlitz while depatures from Milan and Zurich are every second day. All trenhotels trains terminates at the Estació de França station. Prices starts at €74 for second class.
There is also a less-well-known rail line over the Pyrenees to Toulouse. There are four trains per day to La Tor de Querol (Latour-de-Carol), where it is possible to transfer to a French Train bound for Toulouse. The journey takes 7-8 hours (including transfer) and costs roughly 30 Euros one way.