ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hi, I'm trying ot make it function from a file called cars, in the file "cars" it has the following,
Code:
plym fury 1970 73 2500
chevy malibu 1999 60 3000
ford mustang 1965 45 10000
volvo s80 1998 102 9850
ford thundbd 2003 15 10500
chevy malibu 2000 50 3500
bmw 325i 1985 115 450
honda accord 2001 30 6000
ford taurus 2004 10 17000
toyota rav4 2002 180 750
chevy impala 1985 85 1550
ford explor 2003 25 9500
Which brings us back to the question where the newly added 6th column
with the floating point numbers came from ... 3rd time I'm asking about
the same thing in slightly different words.
Which brings us back to the question where the newly added 6th column
with the floating point numbers came from ... 3rd time I'm asking about
the same thing in slightly different words.
And please wrap your file content in code - tags to preserve spacing,
makes it much easier to read.
Cheers,
Tink
My bad! The car file is the input file, and the script is supposed to output each line in the cars file and also add a new column of "miles per year" which is the 6th column. Then if the car is older than the specified argument, mark with a "*" at the beginning of the line.
I've spent about five hours on this today and still having no luck with that part.
My bad! The car file is the input file, and the script is supposed to output each line in the cars file and also add a new column of "miles per year" which is the 6th column. Then if the car is older than the specified argument, mark with a "*" at the beginning of the line.
I've spent about five hours on this today and still having no luck with that part.
I looked at the year, and the other two columns, and your "miles per year", and I can't
make those figures produce the result you computed manually in your desired output. So
which columns did you use to make the floats up?
Thank to you too grail! That's kind of interesting as well, it's kind of cool how there are multiple ways of solving the same problem with Linux! Learned something new with column -t as well! Thanks man!!
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.