'awk' Script Examples

'FEA Scripts'

('complete' code samples)

Home > RefInfo menu > Computer topics menu >

Handy Commands and Scripts Menu page >

'awk' Script Examples (Complete Scripts) menu page >

This 'awk' Script Examples ('FEA Scripts') page.

! UNDER CONSTRUCTION !
Some sample 'awk' scripts on this page may be
replaced, changed, or removed, if/when
I re-visit or use this page.
Also a few more scripts may be added from the
old, pre-2005 'FEA' family of scripts.

! Note !
Descriptions are placed below each link-to-a-script below,
to draw attention to noteworthy 'awk' features of the scripts.

< Go to List of Scripts, below. >
(Skip the following Introduction.)

INTRODUCTION :

There are many tutorial web pages and books that contain 'snippets' of 'awk' code that give an idea of the many things you can do with 'awk' --- in particular, extracting and reformatting and calculating based on contents of text files (or based on text strings 'piped' to the 'awk' command).

However, many of those 'snippet' guides leave one at a loss as to how the 'awk' code can be used within a larger script that contains code leading up to the awk-usage and code that follows up on the awk-usage.

This page is meant to present script examples that amount to 'complete scripts' that make use of 'awk' --- often in conjunction with other commands such as 'grep' and 'sort' and 'sed' and 'ls' and 'find' and 'df' and 'du' and 'ps'.

Many of these 'complete scripts' show how the awk output is presented in a GUI text file displayer --- such as a GUI text editor.


In addition, some of the scripts on this page show that 'awk' is capable of some non-trivial mathematics (other than simple addition and subtraction) --- mathematics that can be useful in an engineering environment.

In fact, some of these scripts were used to convert the format of FEA (Finite Element Analysis) input records to other formats. Some non-trivial mathematics is involved.


Some 'complete' awk scripts :

Many of these 'FEA' code samples are, in some cases, too large for tutorials.

But they have much to offer in the way of examples of working (that is, de-bugged ... to a pretty good extent) 'awk' shell scripting code --- for shell-script developers 'of all stripes'.

I have provided, via this page, many 'FEA Scripts' that use the 'awk' command.

    Note1:
    Some of these 'FEA scripts' may not have enough comments to explain clearly what the script was to do --- and some may not have enough comments to explain clearly the methods being used. But most of the scripts contain more than the usual number of comments.

    Note2:
    I may eventually remove some duplicative scripts --- ones that do not provide a different method of 'awk' usage from other scripts on this page.


How to Use This Page :

The 'list-of-scripts' section below provides a means to see code samples of the 'FEA Scripts'.

Click on a link to see a page presenting a 'complete' awk script.

If you want to save the code to a file on your computer, you can RIGHT-click on the link and use a popup menu option such as 'Save Link Target As ...' to save the file.

    After downloading a script to your computer, you can rename it to change the '.sh.txt' suffix to '.sh'. OR, if you prefer to use script filenames with no suffix, you can rename to remove the entire '.sh.txt' suffix.

    In order to execute the script, you will probably have to change the permissions on the script file --- from read-only to read-write-execute.


You can use the Find-text option of your web browser to look for scripts with certain features. Examples:

If you want to find scripts that use the awk 'substr' function, search this page for 'substr'.

If you want to find scripts that use awk user-defined functions, search this page for 'function'.

If you want to find scripts that use the awk '==' comparison operator, search this page for '=='.

If you want to find scripts that use the awk '!=' (not equal to) comparison operator, search this page for '!='.

If you want to find scripts that use the awk '~' (twiddle) string-match operator, search this page for '~'.

If you want to find scripts that use awk 'if' or 'else' logic, search this page for 'if' or 'else'.

List of Scripts:

End of this List of 'FEA Scripts' that use 'awk'.

Bottom of the
'awk' Script Examples ('FEA Scripts') page.

To return to a previously visited web page location, click on the Back button of your web browser a sufficient number of times. OR, use the History-list option of your web browser.
OR ...

< Go to Table of Contents, above. >

< Go to Top of Page, above. >

Page was created 2018 Jun 16.
Page was created 2018 Jun 17. (Added some info on awk code in about 55 scripts.)
Page was changed 2018 Sep 01. (Added css and javascript to try to handle text-size for smartphones, esp. in portrait orientation.)