In my specific case, I have tried with the swiss road network, by taking the following steps:
Download
swisstlm3d_2022-03_2056_5728.shp.zip
from https://www.swisstopo.admin.ch/en/geodata/landscape/tlm3d.html
In QGIS go to Layer > Add Layer > Add Vector Layer
and adding the following file as Source / Vector Dataset:
swissTLM3D_TLM_STRASSE.shp
Once the file is loaded, go to the just added layer , click the right button of the mouse, and then go to
Export > Save Features As
and use the following options:
With Excel open the just created CSV file. It contains the following fields, but not the x,y,z coordinates of the roads endpoints, nor the intermediary points forming the polylines of the roads....
UUID DATUM_AEND DATUM_ERST ERSTELL_J ERSTELL_M REVISION_J REVISION_M GRUND_AEND HERKUNFT HERKUNFT_J HERKUNFT_M OBJEKTART REVISION_Q KUNSTBAUTE WANDERWEGE BEFAHRBARK EROEFFNUNG STUFE RICHTUNGSG STR_NAME_U NAME BELAGSART KREISEL VERKEHRSBE EIGENTUEME VERKEHRSBD STRNAME
Try using the Extract Vertices tool (QGIS Version 3.20.2). This may be called Extract Nodes in previous versions.
Once you have the output from the nodes, you can use Add Coordinates to Points to get the X, Y, and Z values.
The attributes from the original line data will be carried through to the vertices, which means you could join the data back to the original line file although this would be a 1:M join resulting in a lot of rows - one row per vertex.
Extract the data using the same method as before.