fields.awk database

Under development: PCMCIA, wireless, etc.
Message
Author
musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#61 Post by musher0 »

@cabbie0

I think you forgot to actually zip your fields-bold.awk file. As it is, it's a fake zip.

@all : remove the zip ending and you have the script.

IHTH. BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

cabbie0
Posts: 26
Joined: Thu 23 Jun 2016, 05:19
Location: British Columbia, Canada

Other devices

#62 Post by cabbie0 »

@Pete
I can answer yes for two of those.
Fields.awk will run on a Mac running OSx because I tried it a few years back on a Mac mini.
Who knows if recent shell changes might have nixed that however.

As for tablets, I have fields.awk running on a Samsung Galaxy 7" screen tablet.
This was achieved by installing the ZShaolin terminal emulator app.
( https://play.google.com/store/apps/deta ... olin&hl=en )
You have to copy the executable to /system/bin/
and you have to change the first line to #! system/bin/bash, because that is where their bash executable resides.
However, I have had to use the old system of datafile selection; that is
fields.awk [path_to_datafile]
at which point it works fine.
For some reason the S (data file selection) feature causes error messages.

Also, I'm using Android version 4.4.2 on Model# SM-T230NU and I heard rumors about ZShaolin not running properly anymore on the newer Android versions. I hope that isn't true.
Attachments
fields_on_tablet.jpg
Samsung Galaxy tablet, Android 4.4.2, ZShaolin terminal emulator
(162.3 KiB) Downloaded 266 times

cabbie0
Posts: 26
Joined: Thu 23 Jun 2016, 05:19
Location: British Columbia, Canada

Zip file kerfuffle

#63 Post by cabbie0 »

@all
Sorry about that. Meant to mention that it was a fake zip. Such a small file didn't seem to need actual zipping.

Thank you Christian (musher0) for pointing that out.

@Pete
Thank you for the link to Puppy Linux time line. My, how you've diversified.

User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

#64 Post by Pete »

@cabbie0

Thanks for confirming that it will run on MAC and Android.
Let's hope that the rumors are not true.

I have also asked the wife to load Cygwin on her Win 8.1 machine to try it out.
Will report back.

BTW, in case you weren't aware, there is a simple way to take a screenshot on an Android device:
(Don't know if it works on all devices and versions)

================================

Tap the Android Settings button.

Locate the section titled Device and then tap the Motions and gestures entry.

Make sure that Palm swipe to capture is selected (has a check mark).

Now, simply put the side of your hand (the side of your palm) on the right side
of your Galaxy screen and ‘swipe’ it across to the other side.

You’ll hear the camera “snapping

User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

#65 Post by Pete »

Getting back to which Terminals can handle URL's, I have only managed to get LXTerminal to work.

However, the URL must have a http:// in front else you get an error even though the cursor does change and it becomes underlined.
Web browsers seem to be quite happy without it.
Attachments
URLinLXTerm.png
(15.52 KiB) Downloaded 251 times
URLinLXTermError.png
(35.67 KiB) Downloaded 246 times

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#66 Post by greengeek »

Pete wrote: BTW, in case you weren't aware, there is a simple way to take a screenshot on an Android device........
.
Another common way is to press the power button and volume down button at exactly the same time. As you say - not all models though. Depends on android version.
.

cabbie0
Posts: 26
Joined: Thu 23 Jun 2016, 05:19
Location: British Columbia, Canada

Android screenshot

#67 Post by cabbie0 »

@Pete
Whoa, I didn't know that. Thanks.
On mine, its SETTINGS -> CONTROLS -> PALM MOTION
It wouldn't do it while the keyboard was loaded, but as soon as that was backed off it worked.

@greengeek
Could not get the simultaneous button method to work.
Attachments
Screenshot_2016-06-26-15-17-38.png
Using the palm_swipe method for screen capture....
(77.45 KiB) Downloaded 225 times

mcewanw
Posts: 3169
Joined: Thu 16 Aug 2007, 10:48
Contact:

Re: Miscellaneous

#68 Post by mcewanw »

cabbie0 wrote: Also very interesting regarding the CTRL-click trick for launching a link displayed in LXterminal. Ha!
I tried it with Xfce4-terminal and sakura, but it only worked for LXterminal.
Had the xdg-utils installed from something else apparently...
I've since installed sakura version 3.3.4 on XenialDog and it also now has an Open Link option on right-click. I didn't try it prior to installing xdg-utils, but I expect it needs the xdg-open facility provided by that too. EDIT: It doesn't seem to need xdg-utils afterall (I tried it without).

William
github mcewanw

User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

#69 Post by Pete »

@cabbie0

Glad you got the screen capture going on your Android.

Been looking around the Google play store and there are several Terminal emulators available, some obviously better than others.

Since the end of the month is only a few days away, it's a perfect time for me to get two new toys.
There is a charity shop a few blocks away from the office and they have older model, unloved Android phones at good prices so will get one to experiment.
Even if I brick it, not bothered, just get another one, they are cheap enough.

Second toy which I've been meaning to get for a while now is a Rasp Pie.
Will then load the "official" distro, all 1GB of it (yikes, that is equivalent to 10 puppies) and try out fields.awk amongst other things.

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

#70 Post by greengeek »

Can anyone give me a tip about the best way to present EVERY database entry for inspection please?

Lets assume I have 100 tax receipts entered into my database and want to provide a list of the lot to the IRS - I could do a "read" and allow fields.awk to create a printout in either txt or html format - but I am struggling to ensure that EVERY entry is selected.

If I assume that every entry contains a "cost price" like "$27.50" I could use "$" as my search term - except for one thing - I do not enter the $ sign when I create each record, just the numerical amount. So how do I search and present every database entry?

I also tried searching on "Cost" as I figured that is one of the field names and therefore is relevant to every record - but the read function is not designed to include field names in it's search (for good reasons of course).

If I print out the text file of the database my eyes start to suffer from "colonic" disease :-) So what methods do you recommend for presenting the entire database in human readable form please? cheers!

cabbie0
Posts: 26
Joined: Thu 23 Jun 2016, 05:19
Location: British Columbia, Canada

Inclusive (all-entry) Output Displays

#71 Post by cabbie0 »

@greengeek

Just so happens there's an app for that :)
This is incredibly simple and I don't even know why it works, but it does.
Discovered early on that if you just hit ENTER when prompted for the search string, fields.awk spews out the entire database at one go.
No need to agonize over what might be included in each and every record.

In fact, you don't have to specifically answer the "Save to file?" or "Case sensitive" queries either.
Hitting ENTER on those also just goes with the defaults of "No save" and "Not case sensitive".
So in order to get a full readout of all the entries, just select your database file, launch the READ function, then hit ENTER three times in succession.
However in your case it sounds like you DO want to save the file for a printout, so select SAVE for your txt/html ouput files; then ENTER twice.

Hope that helps.

@Pete
New toys! yeah
I no nothing about the Raspberrries. Please let me know how that goes.

Ian

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

Re: Inclusive (all-entry) Output Displays

#72 Post by greengeek »

cabbie0 wrote:Just so happens there's an app for that :)
Thanks Ian. Nice app! :-) All too easy.

cabbie0
Posts: 26
Joined: Thu 23 Jun 2016, 05:19
Location: British Columbia, Canada

Why it works

#73 Post by cabbie0 »

Perhaps fields.awk reasons that "Searching for nothing" is the same as "Searching for anything"....
Is there a lesson there?

User avatar
greengeek
Posts: 5789
Joined: Tue 20 Jul 2010, 09:34
Location: Republic of Novo Zelande

Re: Why it works

#74 Post by greengeek »

cabbie0 wrote:Perhaps fields.awk reasons that "Searching for nothing" is the same as "Searching for anything"....
Is there a lesson there?
Hmmm, indiscriminate searching. You've just given me an idea. Once I've entered thousands of tax receipts I think I'll print out the lot and send the list to IRS with a polite note saying "Fields.awk thought you might be interested in all these. Please process as required".

Timesaver!
8)

User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

#75 Post by Pete »

Can confirm that fields.awk and fields2html work in Win 8.1 (64 bit) under Cygwin64.

Few notes:

Both fields.awk and fields2html must be placed in /usr/sbin

As fields.awk by default saves the search files to ~/Desktop, one must create this directory in /home/TheUsersName/

For some reason calling fields2html directly in fields.awk did not work, one must change it to ./fields2html .....

After this it worked flawlessly.

Could well be that I never set the PATH under Cygwin but the wife was getting rather tense at my constant moaning at her Windoze computer
so just did a quick test and switched off. :lol:
Attachments
Capture1a.png
(49.11 KiB) Downloaded 122 times
Capture1b.png
(85.59 KiB) Downloaded 116 times
Capture2a.png
(15.88 KiB) Downloaded 118 times

User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

#76 Post by Pete »

So now we know that fields.awk will also work under:

- MAC (OSX)
- BSD
- Android (with Term emulator)
- Windows (only tried 8.1 but no reason to believe that it won't work under 7 and XP).

Now only the Raspberry Pie left.

Perhaps others too like the Banana Pie and Beagle Board but I know nothing about them.

cabbie0
Posts: 26
Joined: Thu 23 Jun 2016, 05:19
Location: British Columbia, Canada

Cross-platform fields.awk

#77 Post by cabbie0 »

@Pete

I never thought I'd see fields.awk running on a Windows machine.
Wonders never cease.
It makes me curious how well/poorly it might be received by that new audience.

User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

Re: Cross-platform fields.awk

#78 Post by Pete »

cabbie0 wrote:@Pete

I never thought I'd see fields.awk running on a Windows machine.
Wonders never cease.
I have to admit that seeing the windows logo and things like /usr/sbin and awk in the same screenshot is a bit strange. :lol:
It makes me curious how well/poorly it might be received by that new audience.
Good question.
My view is that Windows users may be even more reluctant than Linux ones when it comes to using the CLI.

cabbie0
Posts: 26
Joined: Thu 23 Jun 2016, 05:19
Location: British Columbia, Canada

Search Output processing

#79 Post by cabbie0 »

My view is that Windows users may be even more reluctant than Linux ones when it comes to using the CLI.
@Pete
That's my gut feeling as well. Still it's interesting to see how adaptable it is to various versions of the bash shell environment.

@all
greengeek earlier brought up the issue of printing out a read search file containing ALL the records of a given database.
And I answered that hitting the ENTER key at the search prompt would accomplish this.
That's true, and you'll get the output in fields.awk's normal record-by-record display, including all fields in all records.

But what now if you want to create a list of just two or three fields of each record, without tedious editing?

For example, Suppose you have made a full printout of a database with field structure
FIELD1 || FIELD2 || FIELD3 || FIELD4 || FIELD5 || FIELD6 ||

and fields.awk creates a full-record printout of “n

User avatar
Pete
Posts: 660
Joined: Sun 02 Mar 2014, 18:36

#80 Post by Pete »

Hi cabbie0

That is real handy, gonna give it a try.
Thanks for sharing.

Post Reply