Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i need to read the 2nd string from a TXT file and make it a variable for my basic compiler #5493

Open
2 tasks done
curvedlinee opened this issue Feb 14, 2025 · 0 comments
Open
2 tasks done
Labels

Comments

@curvedlinee
Copy link

Question

@echo OFF
SET Spec=ST2.
FOR %%V IN ('TYPE %Spec%') DO SET X=%%V
ECHO %X%
PAUSE

a file ST2. has 2 lines, it goes like this
old ABC

i need a batch that returns a var ABC
2nd line is an empty line
are there batch commands to get the 2nd string ABC?

"old" is the basic compiler's command to load a file ABC
once i exit the basic compiler, i need to send the file "ABC" to a different directory to compile and make an ABC.EXE there
i hope to do it in one batch file

i can not just add a string "ABC" to a batch, it much be read, because i have 10s of "ST2." 's from many directories and they are constantly changing, it depends on what file i am working, ST2. is auto-produced by the macro.

Have you checked that no similar question(s) exist?

  • I have searched and didn't find any similar question.

Code of Conduct & Contributing Guidelines

  • I agree to follow the code of conduct and the contributing guidelines.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant