getting a substring from a text file for later use - parsing

I have a text file that contains version information. There are multiple lines, but the specific line i need looks like this:
#define SW_VERSION "3.4.3.1 R3 08-06-12"
I specifically need the 3.4.3.1 R3 from the text file.
My first thought was to do execute a short script that would grab this data out and use a set for later use, though i am having quite a bit of trouble getting it to work.
I ran this: Find /I "#define SW_VERSION" C:\SW\bin\SW_Version.txt
and it showed me the line in the file that i expected, but i couldn't figure out how to parse it afterwards. Help?

You can write a custom task for Ant.
Your custom task would parse the version line and extract the information you need.

Related

Using signature file in script

I like using .fsi signature files to control visibility. However, if I have both Foo.fsi and Foo.fs files in my solution, and #load "Foo.fs" in a script, it doesn't seem like the corresponding signature file gets used. If I do:
#load "Foo.fsi"
#load "Foo.fs"
... then the desired visibility control happens. Is this the recommended way to achieve this, or is there a better way to do it? In a perfect world, one would like to see the signature file automatically loaded, too.
Not a final answer, but a better way.
From reading Expert F# 4.0 one can do
#load "Foo.fsi" "Foo.fs" "Foo.fsx"
All three loads are on one line.
TL;DR
The link to the book is via WolrdCat just put in a zip code and it will show you locations near there where the book can be found.

SQLWindows - How to check Line Number?

I am new to SQLWindows IDE and I need to edit a number of SQLWindows applications. I am using Version 3.0.0 of the IDE. I am facing trouble finding the line number of a particular line of code. Is there any setting or way to know the line number of the code? Generally IDEs provide the line number, but I am not able to see any line number details in the [Outline] mode. Kindly help!
SQLWindows doesn't use line numbers at all.
If you want to change similar code lines in several files, I suggest getting acquainted with the CDK, which lets you write applications that alter .app/apt/apl files. Unfortunately wasn't able to find a "Starter Guide" on Google.
Im guessing you have corruption in a apl file ? If so save the file as 'text' , ( never save as Binary i.e. 'Compiled' or 'App' always save using the 'Text' option ) then re-open it. 9 out of 10 any line number errors fix automatically this way . Once you have saved as Text , you can open it and edit it ( carefully ) in Notepad++ .
Its very unusual to need to know a line number....why would you possibly want to know it ? If you explain more , there may be a better workaround ( there always is )

Running spss syntax file on multiple data files automatically

I have a spss syntax file that I need to run on multiple files each in a different directory with the same name as the file, and I am trying to too do this automatically. So far I have tried doing it with syntax code and am trying to avoid doing python is spss, but all I have been able to get is the code bellow which does not work.
VECTOR v = key.
LOOP #i = 1 to 41.
GET
FILE=CONCAT('C:\Users\myDir\otherDir\anotherDir\output\',v(#i),'\',v(#i),'.sav').
DATASET NAME Data#i WINDOW=FRONT.
*Do stuff to the opened file
END LOOP.
EXE.
key is the only column in a file that contains all the names of the files.
I am having trouble debugging since I don't know how to print to the screen if it is possible. So my question is: is there a way to get the code above to work, or another option that accomplishes the same thing?
You can't use an expression like that on a GET command. There are two choices. Use the macro language to put this together (see DEFINE in the Command Syntax Reference via the Help menu) or use the SPSSINC PROCESS FILES extension command or your own Python code to select the files with a wildcard.
The extension command or a Python program require the free Python Essentials available from the SPSS Community website or available with your Statistics version.

Filemaker: exporting a PLIST (for iOS)

I have a database which I want to export as an iOS compatible PLIST.
The work around I have come up with is to create a calculated field which adds the tagged padding and header and creates a report using these fields. I then export the preview of the report as a PDF, open the PDF in Acrobat Reader, select all text, copy and paste into XCode which recognises the PLIST format and all works as expected.
Is there a better way of doing this? (This seems a really convoluted way of doing things, high chance of error, etc.) The Export as XML option looks promising but I can't seem to join the dots.
Two ways that I can think of to do what you're trying to do. The most elegant way is probably the XML with XSLT export which you suggest. If you don't already know XSLT, though, you might try the following -- it sounds like with the calculated XML line you've already created, like this would be a simple change to your database:
Create a single new global field, say outputXML
Create a script, say plistCreator
In the plistCreator script:
Set outputXML to ""
Go to the first record you want to export
Loop through every record putting your calculated XML line into outputXML (set field outputXML to outputXML & ΒΆ & calculatedXMLLine)
Go to next record, exit after last
Export Field Contents (note that this is a different command than Export) for outputXML
The cleanest solution is to use the export XML with an XSLT for transforming the output. You'll need to know a little XSLT to do this, or at least be able to customize the examples from FileMaker.

How to Print Rails Source Code?

I'd like to read the Rails 3 source code on printed paper (and preferably in color).
For example, xv6 did a nice job printing their code. It even has line numbers and an index. The only thing I would like to add is syntax highlighting.
Anyone know how any of this is possible?
Here are two possibilities I found:
1. The Listings Package (could this also generate other formats besides PDF, like HTML?)
ftp://ftp.tex.ac.uk/tex-archive/macros/latex/contrib/listings/listings.pdf o
2. Highlight (does it do indexing?)
http://www.andre-simon.de/
We could even add a rake task, print, that generates an up-to-date PDF.
I recomend you use highlight to turn the code into LaTeX and then use Listings to make it into a PDF, then print!

Resources