I'm using Ghidra to reverse engineer an EXE file and save its assembly line code only. Does Ghidra have any function or scripts which exports the assembly line code? I don't want to manually copy the code from the Listing window.
Not sure if you ask about one line or the whole program.
One assembly line can be obtain for example by such script:
addr = toAddr(<address>) print(currentProgram.getListing().getInstructionAt(addr))
if we are talking about the whole program
for instr in currentProgram.getListing().getInstructions(True): print(instr)
but I guess the last one can take a while. More information can be found in the docs about Listing object.