In Horizons, you have to select the right parameters.
The output file is in ssc format.
Change the extenssion to .txt
open a blank excel spreadsheet
open the .txt file in file mode, 'txt,ssc' and retrieve ssc formatting (the fields are separated by ",".
In the generated array, you have to remove the comment lines and keep only the lines that are needed for the orbit.
The 'concatener' function retrieves the columns of each row in a new column. Each information must be separated by a 'space' for .xyz or .xyzv files.
= CONCATENER (P4; ""; S4; ""; T4; ""; U4) (french version), in English = CONCAT (P4; ""; S4; ""; T4; ""; U4)
where
P4 is the cell containing the date
S4 is the cell containing X
T4 is the cell containing Y
U4 is the cell containing Z
please note that there is " " which is inserted between each data.
copy the generated column for each line and paste them into a text file with the extension .xyz or xyzv.