I have a simple batch file that reads the last 10 lines from a batch file and then outputs these 10 lines to a new txt file, but I need it to be output as a line / line, separated by commas.
@echo off
for /f %%i in ('find /v /c "" ^< C:\Path To File\File.txt') do set /a lines=%%i
set /a startLine=%lines% - 10
more /e +%startLine% C:\Path To File\File.txt > Output.txt
Also, is it possible to reorder the lines in the new txt file so that the last line is at the beginning of the line, separated by commas.
An example of what I need:
line1
line2
line3
line4
output as
line4, line3, line2, line1
source
share