1

THis is my code

for /l %%i in (1, 1, %N%) do (
echo !v%%i!
for /f "tokens=* delims=" %%l in ("!v%%i!") do (    
echo %%l >> Linux.cpp     ) 
)

Here i want to copy data in %%l to linux.cpp file Now what happening is if %%l contain abc.cpp this name is stored in linux.cpp. Here i want to store contents in abc.cpp to linux.cpp.

Please help

1 Answer 1

1

If you want the contents of the file to be appended to Linux.cpp then use type (which displays the contents of a file) instead of echo.

e.g. type %%l >> Linux.cpp

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for your help.. Its copying the dat ain file but my intension is to delete CR from windows file. By giving echo only its deleting CR. In type its not deleting carriage return
If i give sample.cpp instead of ("!v%%i!") in for loop its working perfectly. Please help what may be the error

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.