It is a little bit problematic to save RDF data (which "FOAF file" actually is) into some table-like file without sacrificing semantics, because RDF is richer format and converting to CSV is in a way "lossy".
Below is a Python script for naive conversion of RDF into CSV, where each RDF triple is mapped into CSV row (install rdflib library before trying this):
from rdflib import Graph
import csv
g = Graph()
g.parse('http://www.w3.org/People/Berners-Lee/card.rdf', format='xml')
with open('card.csv', 'wb') as csvfile:
writer = csv.writer(csvfile)
for triple in g:
writer.writerow(triple)
To make more sense from RDF one should use some query language and write query (for example, in SPARQL) exactly for the data, which is desired from the RDF file.
It is a little bit problematic to save RDF data (which "FOAF file" actually is) into some table-like file without sacrificing semantics, because RDF is richer format and converting to CSV is in a way "lossy".
Below is a Python script for naive conversion of RDF into CSV, where each RDF triple is mapped into CSV row (install rdflib library before trying this):
To make more sense from RDF one should use some query language and write query (for example, in SPARQL) exactly for the data, which is desired from the RDF file.
Another question/answer which might help you: RDF file to excel-readable format (ttl is another encoding of RDF: RDF/Turtle )