Storing info from plain text

truckerDave

Active Member
Joined
Oct 7, 2023
Messages
229
Reaction score
212
Credits
1,958
Hello. I'm currently building a new PC and will be using Linux on it. As well, as converting 2 windows machines to Linux.

I've had limited experience with Linux (currently running Ubuntu on my old laptop) but am unsure what direction to go. That said, I also have some programming experience with html, Javascript, php and mysql databases.

As an owner operator, I receive what's called a settlement for every load I deliver. It comes via email in plain text with each item labeled the same in each text file. I'd like to be able to copy and paste that plain text into a form and click a button to populate a database, spreadsheet or something similar that is, preferably, searchable.

Currently, I have to enter all the info in by hand (about 30 or so entries per settlement) into a php form that enters it into a mysql database. This takes a lot of time when I may spend 3 or 4 weeks on the road and come home to 20+ settlements.

You may ask, how is this a Linux question? Fair enough. The path I choose will determine which Linux build (is that the correct term?) I go with. If doing a php page and database, I would assume, from lack of knowledge, that one machine will have to be set up as a local server. Or maybe another, easier route, wouldn't require a server at all???

Hopefully, I made all that clear enough. If not, let me know what other info might be helpful.

Thanks!
Dave
 


G'day Dave, Welcome to Linux.org
Distro!!

Not build. I'll try to remember that.
Consider your self forgiven !!...we are not known to be pedantic over minute detail here, mate.

I will watch this thread with interest. Because members are scattered all over the globe, timezones etc play a big part.
 
@truckerDave can you post an example of one of the files you need to process? If the format is clear and always the same, we may be able to skip the PHP file and go directly from files to a SQL Script and insert them into your database, by using command line tools like awk and sed.
 
(Then you can obviously build a PHP interface for tasks you´d need to do after entering them in the DB)
 
Spreadsheets are searchable, & easy to put data into.

Any of the 'main' distros will have an office suite installed.

Don't over complicate things if a simple solution will suffice. ;)
 
@truckerDave can you post an example of one of the files you need to process? If the format is clear and always the same, we may be able to skip the PHP file and go directly from files to a SQL Script and insert them into your database, by using command line tools like awk and sed.
I may once I get the new PC built and the other 2 swapped to Linux. That alone may take weeks as my home time is somewhat limited (generally 34-48 hours per month). I generally take a month off around Christmas. So, I'm hoping to get it all done and operating by the new year.

But more to your question, I can't say they all have the same "clarity". Something with the program that puts them together will make the spacing change up from time to time. However, the "format" has been the same for 7 years.
 
Spreadsheets are searchable, & easy to put data into.

Any of the 'main' distros will have an office suite installed.

Don't over complicate things if a simple solution will suffice. ;)
Spreadsheets are one thing I've never in my 54 years had a need to work with. But I'm sure it's no more difficult to use than any other program.

Are you familiar with a way to take the info in a plain text file and have it inserted to a spreadsheet automatically?
 
Not automatically, but it could be just copy/paste - maybe you could append to a file, but I never have tried to.

When I started out with computers, I was amazed at what spreadsheets could do, well worth a look. :)
 
It's looking like I will most likely be running one of the server distros on the new build. In order to accomplish my goal, from what I've been reading, I will most likely need a way to run php and/or an sql database.

Edit: php will most likely be my best path for parsing the text file to pull out the relevant information. Will look into phpspreadsheets and see if it's feasible for my needs.

Anyone have an opinion on which distro is better these days? I had a machine at one point that ran RedHat. But that was years ago when I dabbled in website design.
 
Last edited:
Everyone has their own favourite distro, but any of the mainline ones would be best - Devuan, Debian, Slackware, etc.
 
The path I choose will determine which Linux build (is that the correct term?) I go with. If doing a php page and database, I would assume, from lack of knowledge, that one machine will have to be set up as a local server. Or maybe another, easier route, wouldn't require a server at all???

I would think any mainstream distro could do this fairly easily.
 
Well folks, after some research, I'm leaning towards Linux Mint with Xampp. I just don't really see a need for a full blown server. I currently run a Windows machine with Wamp installed. Wamp has sufficed for quite some time now. If I need something more robust later on, I can always change it up.
 
As for storing the info from plain text, I'm working on a php script to be able to paste the text file into a text field and have it pull the relevant information. Probably not the most glamorous way to accomplish my goal. But it's working so far.
 

Members online


Latest posts

Top