10-18-2006
Problem with parsing a large file
Hi All,
Following is the sample file
Quote:
91,1
91,2
91,4
91,3
81,2
81,3
81,1
and following is the op desired
that is the last entry of each unique first field is required.
My solution is as follows
Quote:
cut -d "," -f1 rcont | sort -u > 1
$cat 1
81
91
$for var in `cat 1`
> do
> grep $var rcont | tail -1
> done
81,1
91,3
However the original file has around a million entries and around a 100,000 uniques first fields, so this soln. will take damn long time to execute.
Is there a better and faster way of doing it
Regards,
Gaurav
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Hello Everyone,
I can't transfer a large file (~15GB TAR Archive) from one linux machine to another via FTP.
I have tried the following:
1) Normal FTP the whole 15GB. This stops when it gets to about 2GB and doesn't go any further.
2) Split the 15GB file into 500MB pieces using the... (1 Reply)
Discussion started by: VVV
1 Replies
2. Shell Programming and Scripting
Hi Friends,
Getting an error while processing a very large file using an sqlloader........
The file is larger than 2 GB. Now need to change the compiler to 64-bit so that the file can be processed.
Is there any command for the same.
Thanks in advance. (1 Reply)
Discussion started by: Rohini Vijay
1 Replies
3. UNIX for Dummies Questions & Answers
Hi Friends,
I'mfacing a problem while doing ftp of a large file.The control session is getting closed after sometime.But data session transfers the file successfully even when the control seeion is lost.I need to make the control session available as long as data session is active.
How can i... (1 Reply)
Discussion started by: rprajendran
1 Replies
4. Shell Programming and Scripting
I need to parse a large log say 300-400 mb
The commands like awk and cat etc are taking time.
Please help how to process.
I need to process the log for certain values of current date.
But I am unbale to do so. (17 Replies)
Discussion started by: asth
17 Replies
5. UNIX for Advanced & Expert Users
We are experiencing a problem on a lengthy data transfer by FTP through a firewall. Since there are two ports in use on a ftp transfer (data and control), one sits idle while the other's transfering data. The idle port (control) will get timed out and the data transfer won't know that it's... (3 Replies)
Discussion started by: rprajendran
3 Replies
6. Shell Programming and Scripting
Dear Freind
in the file attached how parse the data to be like a normal table
:D (3 Replies)
Discussion started by: saifsafaa
3 Replies
7. UNIX for Dummies Questions & Answers
Hi folks,
I have a big problem.... and need help from your experience/knowledge.
I previously install and use FREEBSD 7.0 release on my storage/backup
file server, for some reason, I can not transfer any files that is bigger
than 1GB. If I transfer it to Freebsd file server, the system... (2 Replies)
Discussion started by: bsdme2
2 Replies
8. UNIX for Dummies Questions & Answers
I have a large file, around 570 gb that I want to copy to tape. However, my tape drive will load only up to 500 gb. I don't have enough space on disk to compress it before copying to tape. Can I compress and tar to tape in one command without writing a compressed disk file?
Any suggestions... (8 Replies)
Discussion started by: iancrozier
8 Replies
9. UNIX for Advanced & Expert Users
Hi ,
I want to transfer one file having 6GB(after compression) which is in .cpk format from one server to other server.
I tried scp command as well as FTP and also split the file then transfer the files thru scp command. At last i am facing the data lost and connection lost issue.
Generally it... (2 Replies)
Discussion started by: Sumit sarangi
2 Replies
10. Shell Programming and Scripting
I have a 1.2G file that contains no newline characters. This is essentially a log file with each entry being exactly 78bits long. The basic format is /DATE/USER/MISC/. The single uniform thing about the file is that that the 8 character is always ":"
I worked with smaller files of the same... (8 Replies)
Discussion started by: os2mac
8 Replies
LEARN ABOUT MINIX
ppmtopgm
ppmtopgm(1) General Commands Manual ppmtopgm(1)
NAME
ppmtopgm - convert a portable pixmap into a portable graymap
SYNOPSIS
ppmtopgm [ppmfile]
DESCRIPTION
Reads a portable pixmap as input. Produces a portable graymap as output. The output is a "black and white" rendering of the original
image, as in a black and white photograph. The quantization formula used is .299 r + .587 g + .114 b.
Note that although there is a pgmtoppm program, it is not necessary for simple conversions from pgm to ppm , because any ppm program can
read pgm (and pbm ) files automatically. pgmtoppm is for colorizing a pgm file. Also, see ppmtorgb3 for a different way of converting
color to gray. And ppmdist generates a grayscale image from a color image, but in a way that makes it easy to differentiate the original
colors, not necessarily a way that looks like a black and white photograph.
QUOTE
Cold-hearted orb that rules the night
Removes the colors from our sight
Red is gray, and yellow white
But we decide which is right
And which is a quantization error.
SEE ALSO
pgmtoppm(1),ppmtorgb3(1),rgb3toppm(1),ppmdist(1),ppm(5),pgm(5)
AUTHOR
Copyright (C) 1989 by Jef Poskanzer.
10 April 2000 ppmtopgm(1)