As an input text-file is filtered, the L4X script determines which
text strings
are read and where they are written.
L4X is particularly useful for importing rows and columns of text from paginated and
tabulated text-files and can
"de-normalize"
reports. It can also import
comma-separated values
from text-files.
Please begin your evaluation of L4X by opening the
L4X demonstrations workbook in Excel.
This "scripted" workbook will automatically
add L4X into Excel
and you will be able to see the L4X menu on Excel's main menu-bar.
In
Excel 2007, you should be able to see the
[Add-ins] tab on the
"ribbon" at the top of the form, click on this tab to find the L4X menu on the
left of the [Add-ins] page.
-
Click on menu item [Open] to open the L4X editor/debugger.
This allows you to
edit and run the
L4X script in the active worksheet, and to
view and/or save the new workbook that
is created by the L4X filter.
-
Click on menu item [Open Text] to open a dialog-box which allows you to
select a text-file
for import, before opening the L4X editor/debugger.
-
Click on menu item [About] to open a form showing version information
about L4X and its licensing status.
-
Click on menu item [Help] to show the help for L4X.
Select a worksheet within this demonstration workbook and click on the
[Open]
menu-item to display the L4X editor/debugger. Then click on the
[Go] button to run the script in the active worksheet.
When the script has been executed, a message-box will be displayed. The butttons in this
message-box give you the option to
either display the output workbook immediately (
NO)
or to save the output workbook before it is displayed (
YES).
Because these demonstration worksheets are protected, you can
run the L4X script on each of its worksheets but you cannot change them.
Open a workbook in excel and select a worksheet without an existing L4X script.
This version of L4X cannot, as yet, process the "native" file formats used by
Excel 2007 so you must save the work book as an Excel 97-2003 (*.xls) file,
before creating an L4X script.
Click on the
[L4X|Open Text] menu-option. You will be asked to confirm your intention
to create a new script, if you answer
YES, L4X will then show a
dialog-box which allows you to
select a text-file for import,
before opening the L4X editor/debugger.
Enter and edit the
L4X statements for the new script
in the
edit-control. You may use the
"
wizard buttons" to
build valid L4X expressions.
Click on the
[Go] button to run your script. When debugging new scripts, any errors
will be displayed in a message-box. The error-message can be reviewed by selecting the
Output/Watch page, or you may view the help-text
for this particular type of
error.
If the script runs successfully, a message-box will be displayed
and you may either display the output workbook immediately (NO) or to rename and save the
workbook before it is displayed (YES).
L4X scripts are saved as a cell "comment" on the worksheet that was active
when you created the script. If you create a script on this worksheet, you should
save the workbook that contains this worksheet in order to save your new script.
If you close a workbook that contains new L4X scripts, you will be prompted by Excel
to save the workbook that contains it. If you do not save the workbook, then the new
script will be discarded.
If you change the
formatting or other contents
of the active worksheet, you
must save the workbook that contains it,
before
running the script, so that the L4X editor/debugger can import text into the latest
version of this worksheet.
Open a workbook in excel and select a worksheet with an L4X script. Then
click on the
[L4X|Open] menu-option, L4X will
then open the L4X editor/debugger.
If you want to
select a different text-file for import,
click on the
[L4X|Open Text] menu option
L4X will then show a dialog-box which allows you to select
a text-file for import, before opening the L4X editor/debugger.
Click on the
[Go] button to run this script. When it has has completed,
a message-box will be displayed. The butttons in this message-box give you the option to
either display the output workbook immediately (NO) or to rename and save the workbook
before it is displayed (YES).
L4X scripts are saved as a cell "comment" on the worksheet that was active
when you opened the script. If you change the script on this worksheet, you should
save the workbook that contains this worksheet in order to save your changed script.
If you close a workbook that contains un-saved L4X scripts, you will be prompted by Excel
to save the workbook that contains it. If you do not save the workbook, then changes
to the script will be discarded.
If you change the
formatting or other contents
of the active worksheet, you
must save the workbook that contains it,
before
running the script, so that the L4X editor/debugger can import text into the latest
version of this worksheet.
L4X can automatically extract plain (ASCII) text from PDF, PCL (pcl5) and OS400
spooled-files.
Select a text-file for import by:
-
Clicking on the [Open Text] option of the L4X menu on the Excel
menu-bar.
-
Clicking on the [Open] button of the
edit/go form.
-
Dragging a text-file and dropping it onto the text control of the
edit/go form.
L4X will remember the text-file that was last used with any particular script
and will, if possible, re-open it automatically. When creating a new
script, the last text-file selected will be re-opened. However,
the text-file may have been deleted or moved since that time and,
in such cases, you will be asked to select another text-file.
L4X scripts will not run unless you have selected a text-file for import.
Text import errors occur either when the text-file selected for import does not exist
or when it cannot be converted into plain ASCII text.
Open the
L4X demonstrations work-book
to automatically install L4X as an Excel "add-in".
You will be asked to run macros published by
PDFing
and you must allow them to run before L4X can be added-in.
If everything is O.K. you will see that a menu
named "L4X" has been added to the Excel menu bar, just to the left
of the Excel [Help] menu.
If you are using
Excel 2007, you should instead
see the [Add-ins] tab on the "ribbon" at the top of the form,
click on this tab to find the L4X menu on the left of the page.
To remove L4X from Excel, start Excel
and select the [Tools|Add-Ins] menu option. You will see a list
of the add-ins available for Excel, select "L4X for Text Import"
and un-check the box. If everything is O.K. you will no longer see
the "L4X" menu.
To add L4X into Excel, start Excel
and select the [Tools|Add-Ins] menu option. You will see a list
of the add-ins available for Excel. If necessary, click on the [Browse] button
and search for the L4X add-in file: L4X.xla, which will be in
the folder you specified during the installation of L4X. When you have selected
this file, you should see the name "L4X for Text Import"
appear in the list of add-ins. Check the box by the "L4X for Text-import"
and then click O.K. If everything is O.K. you will see that a menu
named "L4X" has been added to the Excel menu bar, just to the left
of the Excel [Help] menu.
In Excel 2007, you should instead click first on the "Microsoft Office"
button, then on the "Excel Options" button, then on the "Add-Ins"
option and, finally, on the Go button for "Manage: Excel Add-ins". This
will display the list of add-ins, which can be managed as described above.
Select the [L4X|About] menu-option, L4X will then show an "about"
form which allows you to enter your license-key.
When you click on the [OK] button, your copy of L4X will be licensed.
L4X will run without a license, but will only output a maximum of 200 rows to a
worksheet. However, scripts created using L4X will run without limitations
when deployed for use within a fully licensed copy of PDFing.
The L4X filter is an integral part of the L4X
editor/debugger,
which "adds-in" to Excel,
but it can also read and write
"scripted" workbooks
without MS Excel being installed.
Once you have created and tested a
"scripted"
workbook, it can be used within
PDFing to import text from a spooled-file
into a worksheet.
You must first copy the "scripted" workbook to directory:
\PDFing\Markup.
PDFing will select this excel file when requested and run the script(s) it contains
to control the import of the spooled-file text into worksheet(s) within an ouput workbook.
PDFing may be configured so that this "scripted" file is selected when either:
-
The excel file-name (without the .xls extension) matches one of the names specified in
the default markup controls. The control labelled "Convert to excel ?" must
be set to YES.
-
The excel file-name (without the .xls extension) has the same name as the
the currently selected "markup" file. The control labelled
"Convert to excel ?" must be set to YES.
-
The excel file-name (without the .xls extension) is specified on the [Convert] tab
of the currently selected "markup" file. The control labelled
"Convert to excel ?" must be set to YES.
-
The excel file-name (without the .xls extension) is specified by the "tag"
ECX=xxxx sent with the spooled-file data.
L4X should not be confused with
Lua for PDFing, which is
language "embedded" in
PDFing,
that allows for the extensive customisation of its behaviour. However a
Lua for PDFing script can be developed and debugged using program:
L4p.exe which is installed as part of this L4X editor/debugger.
This document
©Jane Hearn 2008.
All Microsoft trademarks acknowledged.