how to group data in linux
Greetings!
My file looks like this Code:
ID Num1 Num2 I have tried writing some awk commands but cannot figure it out how to put conditions in the command. (I am trying to use the command in loop for the creation of multiple files). In python code looks like this: Code:
infile=open("Input.txt","r") Thanks! |
I would say awk will not be faster, so better to try to speed up using python.
You never close outfile which may cause problems. can you tell us something about the size of this file and the running time? |
the bigger a plate of food the longer it will take to eat all of it.
|
BW-userx, you seem to have formed a pattern of posting off-topic or non-constructive comments. Please refrain from this moving forward. If you have any questions, feel free to contact a mod or myself directly.
--jeremy |
Quote:
|
Quote:
is a metaphoric explanation as to why it takes longer to process bigger files then smaller ones. if you need me to PM that to you I will. in reference to this in post #1 "it's working but the file is too huge, so it is taking a lot of time." and this in post #2 I would say awk will not be faster, so better to try to speed up using python. |
Quote:
1st file should look like this: Code:
1 1 2 Code:
4 10 20 |
Quote:
The file is almost 600 GB. |
I would say you can try:
Code:
time cat file > newname |
Quote:
Thank You! |
600GB is quite a massive file for a text file.
I think the best way to approach it is to split into multiple files, into multiple outputs, then combine the multiple output to a manageable file and come up with a desired output. I'm just curious what text editor do you use to open the 600GB file? |
Quote:
Quote:
|
Quote:
I am using vi as a text editor. |
Quote:
|
probably you need to generate several pieces instead of that one big file.
|
All times are GMT -5. The time now is 06:40 PM. |