in reply to redirecting output from a system command to a text file

It should not make a difference. Are you sure that there are no "bad" characters in $a? What is the output of
print "./TVT.exe $a >test.txt";

Replies are listed 'Best First'.
Re^2: redirecting output from a system command to a text file
by mark4444az (Sexton) on Apr 19, 2011 at 18:59 UTC
    when I do print"./TVT.exe $a >test.txt"; It prints exactly the path and the name of the file I want, plus it has TVT.exe in front of it. I agree, it shouldn't make any difference.
      But what is the name of the file? I'm guessing that your shell doesn't like "#", maybe treating it as the start of a comment.
        In this instance there is a #. The full name of the file is: Test/W001#00100/TestReport_W001#00100_110327_235516.pdf But.. The thing is it is actually running the TVT.exe on that file, I can see the data being printed to the console. When I explicitly type the file name in the command the data goes right into the test.txt file, like it should. When i use the $a variable (and I did put a print right before the execute statement to ensure the right file name is in there)the data goes to the console and it creates an empty text file. I have also tried 1>StdOut.txt 2>StdErr.txt, no joy there either. It just creates 2 empty text files.