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.
Originally posted by arnulfo
first, how do you sort lines of a file given that each line has a date of format
%d %b %Y
You could have been a little more specific, i.e. what programming language, and how do the lines look like, especially after the date. Assuming bash, and that there will be space after the date, and that the dates are at the start of the line this bash-script will do it:
ive already done the sort by date part.
what i need is to format the prices from the raw data into the output i said earlier.
and i cant use perl because this is a homework hehe
You abuse people's willingness to help you (like me in this case).
If you did things yourself, and then get stuck, post the code you have so far, and state that it is a home work assignment... That would be different, and OK.
who are you to judge someone that he diditn learn anything. who cares if its a homework. im not asking you and just copying every code that yo write here. and by the way, its not a homework, its a project. and its just a boogerly size of a problem compared to the whole code. I just didnt know that there was a %s
option for date, thats all. so dont be too self-righteous. "abuse my willingness"... hahahaha
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.