file 2:
I want to get the 6th column from file 1 (example, 666) and check in file 2 for the value in the 2nd column (AAA). Then print the file2 value (AAA) at the end of file1. Results should be as below:
result:
I already have a code for this but I found it to be slow (file1 has about a million lines while file2 has about 20,000 lines). I think there should be a faster way of doing this. See below for the code I did:
Hope you can help.
Thanks in advance!
Last edited by Scrutinizer; 07-13-2012 at 10:25 AM..
Reason: code tags for data files
Hi ,
I learning shell scripting..
I need to do the following in my shell script.
Search a given logfile for two\more strings.
If the the two strings are found. write it to a outputfile
if only one of the string is found, write the found string in one output file
and other in other... (2 Replies)
can someone help me with the find and replace command.
I have a input file which is in the below format:
0011200ALN00000000009EGYPT 000000000000199900000
0011200ALN00000000009EGYPT 000000000000199900000
0011200ALN00000000008EGYPT 000000000000199800000
0011200ALN00000000009EGYPT ... (20 Replies)
I have a rather complicated search and replace I need to do among several dozen files and over a hundred occurrences. My site is written in PHP and throughout the old code, you will find things like
die("Operation Aborted due to.....");
For my new design skins for the site, I need to get... (2 Replies)
Hi,
The below code will search a particular string(say false in this case) and return me 10 lines above and below the search string in a file.
" awk 'c-->0;$0~s{if(b)for(c=b+1;c>1;c--)print r;print("***********************************");print;c=a;}b{r=$
0}' b=10 a=10 s="false" "
... (5 Replies)
hi,
im trying to find the longest word in /usr/share/dict/words that does not contain the letter i.
i've tried using the wc -L command like so: $ wc -L /usr/share/dict/words
which basically tells me the longest word which is good but how do i get the longest word which Does not contain the... (7 Replies)
Hello!
I have text file:
From aaa@bbb Fri Jun 1 10:04:29 2010
--____OSPHWOJQGRPHNTTXKYGR____
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
My code '234565'. ... (2 Replies)
I have three variables $a, $b and $c
$a = file_abc_123.txt
$b = 123
$c = 100
I want to search if $b is present in $a. If it is present, then i want to replace that portion by $c.
Here $b = 123 is present in "file_abc_123.txt", so i need the output as "file_abc_100.txt'
How can this be... (3 Replies)
Hi All
I have a requirement to find the file that are most latest to be modified in each directory. Can somebody help with the command please?
E.g of the problem.
The directory A is having sub directory which are having subdirectory an so on.
I need a command which will find the... (2 Replies)
I'm trying to find folders created by a propritary data aquisition software with the .aps ending--yes, I have never encountered folder with a suffix before (some files also end in .aps) and sort them by date. I need the whole path
ls -dt "$dataDir"*".aps"does exactly what I want except for the... (2 Replies)
I have a simple script that reads in data from fileA.txt and searches line by line for that data in multiple files (*multfiles.txt). It only prints the data when there is more than 1 instance of it. The problem is that its really slow (3+ hours) to complete the entire process. There are nearly 1500... (10 Replies)