0

I try to use a .txt data in many different folders, so I thought It is enough to put it in the parent folder and all my Latex data can access to it and can also increment the numbers in the .txt data which is in the parent folder. Unfortunately there is an error, which forbid me to change the .txt data in the parent folder. I don't know how to solve this problem.

I would be happy, If someone of you have a solution for my problem.

\newwrite\NoFile
\newread\NoFile
\newcounter{NoRe}
\openin\NoFile=/Users/.../Desktop/.../.../PF/NoFile.txt%
\read\NoFile to \fileline
\setcounter{NoRe}{\fileline}
\closein\NoFile
\stepcounter{NoRe}
\immediate\openout\NoFile=/Users/.../.../.../.../PF/NoFile.txt
\immediate\write\NoFile{\theNoRe}
\immediate\closeout\NoFile
4
  • By default latex can only write to directories below the current directory for security reasons. You can (in texlive, i do not know about miktex) disable this security if you wish, and you trust your documents (ie don't run documents from random internet sites if you have lowered the security...) Commented Jan 21, 2021 at 23:43
  • assuming (from your paths) you have bash shell and a linux texlive , you can probably use a commandline of open_out=any pdflatex myfile Commented Jan 21, 2021 at 23:46
  • Thank you for your answer, I think it is easier if I create subfolder and save the .txt data there. After that my the automator will take the .txt data and send it to the other folders. Commented Jan 22, 2021 at 0:23
  • writing to subfolders is allowed by default. Commented Jan 22, 2021 at 0:38

0

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.