Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Bash Script Read Large File

  • 30-03-2009 2:01pm
    #1
    Registered Users, Registered Users 2 Posts: 528 ✭✭✭


    Hi All,

    Im back again with more bash problems. I have a script that reads in a file line by line using "while read line". The problem I have is the file is rather large ~5Gb. As the file is large the execution of the script takes forever. I need to know if there is a way of improving the speed of the execution. Basically what the script does is read in the file, places the lines where the first field matches into a seperate file and then performs some simple arithmetic with the fields in the new file. Any help would be very much appreciated. Thanks in advance.


Comments

  • Closed Accounts Posts: 6,151 ✭✭✭Thomas_S_Hunterson


    Could you just use grep to get the required lines and > them into the new file.


  • Registered Users, Registered Users 2 Posts: 528 ✭✭✭ridonkulous


    Yes. Yes i could. So simple and yet I managed to miss it. Im too used to programming in C++. Thanks for that.


Advertisement