Need a direction for an app I want to write

jersiq

Senior member
May 18, 2005
887
1
0
I know enough to get myself in trouble with programming. I've only taken Java and C++ in school so far, so I don't have too much knowledge other than the OOP ideas and simple programming basics.

So the basic idea that I want to write an app for is this.

I am given a plain text file (this is the only way I can receive the data) with a list of statuses of company materials) For example it may look like:

CAR 11 OVERHEATED ENGINE
CAR 127 BAD ALTERNATOR
CAR 235 DEFECTIVE BATTERY
CAR 7 OVERHEATED ENGINE

Now I want to just get a list of all the assets that only have OVERHEATED ENGINE for example. My idea is to just cut and paste my original list into a text area and have the app output in a separate text area of the window the statuses I am looking for. I may be separately looking for different failures, so it's never just the same status I am looking for. I don't need all of the data to be separated, I have specific assets I have to sift out of some extraneous data.

So my question is: What would be the best language to tackle this in? Unfortunately, Perl is already disqualified due to user restrictions on programs. Taking a gander around the internet, C++ and Java may not be the best solutions. I have no aversion to learning something new, so are there other languages I could write this in? I've started to do this through VBA in Excel, but it doesn't seem to be the best fit for what I am looking for.
 

Spad3S

Junior Member
Jul 24, 2007
4
0
0
I would say just do it in Java. Does this have to be web available or just run as a program on your desktop?. Either way you do it, just read in the text file with java file io, parse each line and save it to an assets object that you create that stores the information in the text file. So in your example the object would have 3 member variables. Then you can make a list of the objects, which will allow you to traverse and search through them to display what ever you desire in your ui.
 

EagleKeeper

Discussion Club Moderator<br>Elite Member
Staff member
Oct 30, 2000
42,589
5
0
Any language that you feel comfortable and that is easy to document.

To read and parse the file should be simple.

The kicker will be the UI for presentation and adaptability
 

BoberFett

Lifer
Oct 9, 1999
37,562
9
81
How many files? How many lines per file?

Without knowing more details, I'd say use Excel and just parse it with a simple formula or macro. No UI needed. You've got all your filtering, sorting, counting, etc. built right in.

No need to build a forge in your backyard to make a hammer to pound in a nail. Just borrow your neighbor's hammer.
 

sourceninja

Diamond Member
Mar 8, 2005
8,805
65
91
I'd just use the FINDSTR command and write a batch file. Pass it the text file and output a text file with the data you want.

But I'm a command line whore.
 

Gamingphreek

Lifer
Mar 31, 2003
11,679
0
81
Python is as good, if not better than Perl for this sort of thing.

Out of Java and C you will find that they are very similar. C++ should be, at least in my mind easier than both Java and C. ifstream and ofstream make this really really easy in C++.

All of this said, I recently started coding in C# and it is rather elegant. Kind of a happy medium between Java and C++.

All in all, reading from a text file is very very simple and you really can't go wrong with whatever language you choose.

-Kevin
 

Sureshot324

Diamond Member
Feb 4, 2003
3,370
0
71
Pretty much any programming/scripting language you can think of can do this easily. If you want your app to have a GUI Java would be a good choice.
 

OogyWaWa

Senior member
Jan 20, 2009
623
0
71
perl could do this very, very simply. any language with good regex can tackle this issue no problem...