hello i am posting this question on both the VB and the awk forums, as i dont know if my error is VB or gawk related.
this is a variation of the question i posted earlier on the awk forum.
if you can, please answer either the VB side of this or the awk (gawk) side of this problem.
i installed gawk successfully on a MS windows XP PC and my awk script runs successully in a command window. however i created a VB6 form to select several file options before executing gawk.
the gawk script is named [airnew.awk], the input file is [for033.dat] and the output file is [junk.out].
my VB6 commands are as follows:
Private Sub rungawk_Click()
Open App.Path & "\junk.out" For Output As #1
comstring = "C:\Program Files\GnuWin32\bin\gawk.exe " & scriptname & " " & strinputfile & " " & "> " & App.Path & "\junk.out"""
rtb1.Text = comstring
Shell comstring, vbNormalFocus
Close #1
End Sub
the resulting command string (printed to a text box to verify syntax) is:
C:\Program Files\GnuWin32\bin\gawk.exe E:\HeatSynch\Codes\gawkrunner\airnew.awk E:\HeatSynch\Codes\gawkrunner\for033.dat > E:\HeatSynch\Codes\gawkrunner\junk.out"
when i click the "rungawk" button, a command window flashes open and closed. the [junk.out] file is created but is left empty.
any guidance would be appreciated.
daveleo
this is a variation of the question i posted earlier on the awk forum.
if you can, please answer either the VB side of this or the awk (gawk) side of this problem.
i installed gawk successfully on a MS windows XP PC and my awk script runs successully in a command window. however i created a VB6 form to select several file options before executing gawk.
the gawk script is named [airnew.awk], the input file is [for033.dat] and the output file is [junk.out].
my VB6 commands are as follows:
Private Sub rungawk_Click()
Open App.Path & "\junk.out" For Output As #1
comstring = "C:\Program Files\GnuWin32\bin\gawk.exe " & scriptname & " " & strinputfile & " " & "> " & App.Path & "\junk.out"""
rtb1.Text = comstring
Shell comstring, vbNormalFocus
Close #1
End Sub
the resulting command string (printed to a text box to verify syntax) is:
C:\Program Files\GnuWin32\bin\gawk.exe E:\HeatSynch\Codes\gawkrunner\airnew.awk E:\HeatSynch\Codes\gawkrunner\for033.dat > E:\HeatSynch\Codes\gawkrunner\junk.out"
when i click the "rungawk" button, a command window flashes open and closed. the [junk.out] file is created but is left empty.
any guidance would be appreciated.
daveleo