Running Awk scripts from within VB 
Author Message
 Running Awk scripts from within VB

Does anyone know if its possible to run awk from within a VB macro?

Basically we want to be able to get a data file, reformat it with awk,
and then read it into a Access database all at the push of a button. We
have a working awk script, and a working "read in data" macro but would
like to be able to combine the two to simplify thew process from the
users point of view.

Thanks a lot in advance

Bil



Fri, 04 Jan 2002 03:00:00 GMT  
 Running Awk scripts from within VB
Use the GAWK DLL and access it from your VB script.

--
Best regards,
 _ __                      _    ,   _ _ _
' )  )     /         _/_  ' )  /   ' ) ) )
 /--' ____/___/> __  /     /--/     / / / __,_  __  o _   ______
/  \_(_) /_) (__/ (_<__   /  ( o   / ' (_(_) (_/ (_<_/_)_(_) / <_

Robert H. Morrison                      Tel:   +49 721 9628 167
Software Development, Basis Team        FAX:   +49 721 9628 149



Quote:
> Does anyone know if its possible to run awk from within a VB macro?

> Basically we want to be able to get a data file, reformat it with awk,
> and then read it into a Access database all at the push of a button. We
> have a working awk script, and a working "read in data" macro but would
> like to be able to combine the two to simplify thew process from the
> users point of view.

> Thanks a lot in advance

> Bil



Fri, 04 Jan 2002 03:00:00 GMT  
 Running Awk scripts from within VB


Quote:
>Does anyone know if its possible to run awk from within a VB macro?

>Basically we want to be able to get a data file, reformat it with awk,
>and then read it into a Access database all at the push of a button. We
>have a working awk script, and a working "read in data" macro but would
>like to be able to combine the two to simplify thew process from the
>users point of view.

Going off on a slight tangent, you may want to consider using perl for
this sort of thing. Reason: perl can connect via OLE to any Microsoft
Office application, including Access, and use the applications' object
hierarchy directly. Perl could parse the data AND feed it into fields
in various Access tables all within the same perl script. Perl would
also allow you to catch and resolve parsing errors while you're reading
through the source data, something GAWKDLL can't.

The difficulty with GAWKDLL is that there's no stdout - DLLs don't
handle I/O that way. So GAWKDLL output would be written to files, and
Access would need to read these files line by line after GAWKDLL had
finished. Inefficient compared to the perl alternative.

I use awk to parse data from captured screen images from mainframe CICS
applications (data for which the IT powers that be refuse to provide
read access to the underlying tables). I have the terminal emulator
macro that captures these screens run awk to parse the captured text
into .CSV files that can be read directly into Excel or Access. You may
find it less of a headache to simply preprocess the datafiles so users
have access to files that have already passed through your awk filters.

Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.



Fri, 04 Jan 2002 03:00:00 GMT  
 Running Awk scripts from within VB
Videosoft produce an ActiveX control called VSAWK that allows you to do
awkish things in VB.  You might like to visit their web site for more inf.

Peter

Quote:

>Does anyone know if its possible to run awk from within a VB macro?

<snip>


Sat, 05 Jan 2002 03:00:00 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Run awk from within sed script?

2. Access to Script Name Within Awk Script

3. Running a TK script using wish80.exe within a tcl script

4. Running scripts within scripts

5. Problems with Fortran dll run within VB.

6. Replacing a string from an input file within awk script

7. trying to call awk from within a shell script

8. shell commands within awk script

9. using Oracle within an awk script

10. Simple awk command within a perl script

11. awk within ksh script

12. Shell variable within an awk script

 

 
Powered by phpBB® Forum Software