I've got these machine that output a lot of data. Unfortunately, the files outputted are structured in a strange way. I'd like to be able to do some complex text processing (perl style) to parse the data and be able to output to Excel format. I'd also like to automate this but the only server that I can use is running Windows XP (with Office) and I'm not allowed to install any extraneous software (no .NET, Powershell, ActivePerl, etc.)
What is the best way to do this? Are regex in VB/VBA powerful enough for me to script in Excel?
I'd recommend using something like AutoIt. It has an inbuilt regex engine and there is an excel standard include. It can compile to a standalone exe so fits the bill. It's also pretty simple as a langauge, so shouldn't take to long to figure out coming from other languages.
Related
Similar to this question What programming languages are installed by default on Windows 7?. Is the environment any differnt for Windows 10?
For some programs like MS OFfice you get the VBA, Chrome you would get Javascript, if you activate the Bash for Ubuntu on Windows then you can get bash. Not sure if that is default.
In particular, if you didn't have administration rights over a Windows 10 laptop but needed a programming language... what could you use or do about it?
ie I wanted Ruby installed but I needed our tech team to help me. I want to avoid someone else with higher access but also not breach policy.
Out of the box no install solutions include:
(To be written using text file editing software like the preinstalled notepad)
Batch (.bat)
Visual basic script (.vbs)
HTML (.html)
CSS (^Use a style tag for the HTML doc)
JavaScript (.js)
Some quick gets include:
Bash (Ubuntu from Windows Store)
AutoHotKey (from autohotkey.com)
#Code (Windows Store. Apparently supports 12 different languages)
Hope this helps!
Edit: If you really wanna try, you can edit .exe files directly but yeesh.
Edit 2: repl.it is a website that lets you code in tons of different languages, possibly Ruby. With repl.it you can do all the things I've listed and more! (As long as you have alright internet.)
what could you use
You could use pretty much any languages. Any compiled executables looks the same to the OS as any other.
The only catch is that some languages' runtime libraries are quite big, so it's common for smaller programs not to include the entire language runtime and instead expects it to be preinstalled on the machine to keep its own download size small.
However, even high level scripting languages that requires huge runtime support libraries can often be packaged into standalone executable, so that you don't need to install the runtime yourself.
Ultimately it depends on what you wanted to do. If you wanted to just make simple scripts, probably .bat scripts will do just fine. If you wanted something simple and fast, then you can write native executable in C, otherwise if you want to do something a bit more complex and you're fine with the larger download size if you can keep your own program simple, or if you can later get admin to preinstall your preferred runtime on your target machines, then high level languages like Python or Ruby would be great options.
I work in a secure data environment so my ability to install software is pretty limited. I have Notepad++, but don't have TextFx (and I read it doesn't work in the current version anyway). I don't have the Python plugin for Notepad++ either. No AHK, etc. OS is Windows XP.
I'm trying to find another way to write a basic script that I can use to insert a time and date stamp into any text editor. I did some googling but couldn't find any specific examples.
I noticed that Notepad uses F5 for date/time stamp, so I tried to find the file/code it uses for that, but no luck.
Any tips? Looking for something like a batch file I can assign a KB shortcut to use across text editors, Word, or whatever. Thanks!
What it sounds like you are looking for would be a key macro. The functionality you are describing is implemented within the program itself, and is not available for global usage throughout the OS.
As you are on Windows XP I am not sure what options are available without a software installation. There is no built in macro recorder for Windows XP unfortunately.
If you are in Word, then you could use the built in Office macros to accomplish this. How exactly depends on your version of Office.
Is there someone that can suggest me a programming language that allows you to write quickly GUI programs (on windows platform)?
P.S. I am interested on only languages that do not rely on virtual machines and then have a compiler that produces executable code directly on the machine
I would go with AutoIT, it's a very easy to learn windows scripting language with tons of functionalities: http://www.autoitscript.com/autoit3/index.shtml
I'm using it to automate some tasks, but it can do way more than that.
EDIT
Just to make things a little bit clearer for everybody:
You can create new applications using AutoIT and the Aut2Exe compiler provided. The .exe files created are stand-alone, thus require no other files but the files that you might need in your app. Everything is free and the AutoIT scripting language has a BASIC-like syntax.
The GUI that you'll use are standard Windows controls. Among the functionalities you have the possibility to automate keystrokes/mouse movements, call the Windows API and external .dlls, manipulate windows and processes and through user created libraries (called UDFs) you can even acces local databases, manage networking tasks, encryption, archiving and many more.
All I can say is that it's worth take a look and the first app I built with AutoIT was done in roughly 8 hours since I started learning. It took a folder as the source and copied everything in a chosen directory, copying files in folders named as the date when the files were created. So the destination directory would have a series of subfolders like:
11.11.2010
whatever.txt
whatever.png
12.11.2010
archive.zip
and so on. Just 8 hours and got me rid of a lot of effort ordering the files myself.
Any .NET will probably be what you're after.
Start with VB.NET which is now called Visual Basic CCYY eg (Visual Basic 2005, Visual Basic 2008, Visual Basic 2010).
If you want something not using .NET framework, you might as well go back to older version of VB and if you want something compilable that'd be like C++ with their MFC (Microsoft Foundation Class).
You need to give more info on the type of gui and what you're using it for. This could be accomplished with Microsoft Access forms and VBA, or you could make an HTML Application (.hta).
I'll put in a vote for Delphi. You can easily write applications by dragging and dropping components on to a form and doing minimal coding in Pascal, which isn't hard to learn. Later, if you decide to go deeper, you can do pretty much whatever you want. And it compiles to native executable code.
Is an executable bundler, that combines the script with the framework/interpreter, good enough?
If so, you might look at Tcl/Tk or Lua.
http://www.powerbasic.com/
http://www.powerbasic.com/aboutpb.asp
Seems like it has a RAD GUI and of course it's BASIC, plus it compiles down to .exe (as I understand it.) Might be worth checking out.
A 'quick and simple' language will only allow you to do 'quick and simple' things - and for those, having a VM or not wont make much of a difference to you.
For quick and simple & native code, about all I can think of is RealBasic. Its cross platform Windows/Mac/Linux. I find their IDE to be difficult to work with due to its inflexibility and the help system last I looked wasnt that great, but the underlying language isnt bad and does compile to native code. So it might do the trick for you.
what's a good way to scripting or creating programs unders windows?
How about python?
You will need Notepad, and to learn JScript (not Javascript... JScript), VBScript or Batch. Then you can easily create small scripts, somewhat equivalent to bash shell scripts on Linux.
For the first two, you can read the Windows Script Host documentation.
Windows Powershell is becoming the new Windows scripting language. Being a full .NET language, it is inevitably much more powerful that the horrible old batch scripts one used to have to write (and still retains much of the syntactic sugar of scripting/shell languages).
You can do VBScript without the need to install anything.
Open notepad and enter the following text:
MsgBox "Hello"
Save it as filename.vbs
Double click the file you just created, congratulations - you just created and ran a VBScript.
I'd like to plug AutoIt. It's a free download and comes with it's own editor that can be quickly/easily installed anywhere. The language is very rich and comes with a large library of user defined functions. Integrated context-sensitive help with syntax display. There's even a GUI editor. A final plus is that it compiles to .exe so will run on any win2k/xp/vista/2k3/2k8/7 PC.
I always use Python for scripting on Windows.
A vague question usually gets a vague response.
Download a compiler or interpreter and find a tutorial.
With more information we can better point you in the right direction
I would say there are three clever choices here:
Scripting: Use JSCRIPT because much of what you learn about JSCRIPT can be used in Javascript. You can either graduate to Javascript/AJAX in the browser, or Microsoft .HTA apps.
Or, you could use Python because it has standard modules to do just about anything a sysadmin would do plus addons to access Windows .COM objects and WMI. You can then either graduate to Python on a UNIX platform, Jython (which is Python in the JVM) or IronPython which opens up the entire world of .NET for you.
And there is of course, the non-scripting choice which is about creating programs under Windows. If you choose this you probably have an end-game in mind that is beyond scripting, so start with SharpDevelop and IronPython. Then, as you gain confidence, start working with C# still using the same Sharpdevelop toolset. With this choice you can also graduate to UNIX applications using the MONO .NET environment although if you want to do GUI apps on UNIX you will need to use GTK# instead of Windows Forms.
I'd like to do some light data processing - a little binary data manipulation followed by conversion to text serialization. The result is written to a file, and processed by an external program (run by my program). The data processing is more than I'd care to consider doing in batch files.
I'd prefer to use a scripting language, but not have to install the language first. The target computers are mostly older Windows boxes, which are disconnected from the network (no updates, such as PowerShell)
I'm not familiar with the various language's tools for creating EXE files. Which ones have solutions that work well and don't produce huge files? (i.e., whole interpreter package plus my script.)
For my money (its free) AutoIt 3 is exactly what your looking for. AutoIt produces relatively (250k is the standard overhead) small stand alone exes. It has a full perl like regex engine so your light data processing should be a breeze (I've written some pretty heavy data processing scripts in it myself). When downloading autoit be sure to get the full version including Scite this makes compile to exe a one click operation.
I know I might get flamed for this, but VB 6 is a viable option. Since XP SP2 (I think, possibly earlier), Windows has come with its runtimes installed. Not sure about vista.
Theres also the Windows Scripting Host that uses VBScript and JScript.
http://en.wikipedia.org/wiki/Windows_Script_Host
Lua is an excellent choice for that kind of stuff. You can integrate it in your executable or use the standalone Lua interpreter to run your scripts.
While waiting for answers I ran across Shoes, which can make Ruby .exe (I'm most familiar with Ruby) I got it mostly working, although the size of 2.4MB was a bit larger than I'd like. However, I found that it would crash when changing application focus.
I switched to a 'regular' terminal script, and found rubyscript2exe, which, after working around a problem with rubygems, seems to work, and creates a ~700kb file.
I did rather like some of the options presented, but it's not worth redeveloping at this point.
Python with py2exe. Depends on what you mean by small though.
Would using PowerShell script be something you've considered. The data processing might be richer there.
Why not knock up a .NET application? There are free editions of the IDE, and the Framework comes with Windows as a standard component (which also includes a C# compiler, as it happens.)