Field Seperator: `~
The concept is to start with SNA in the 3rd Field.
Fetch the 4th field, search that 4th field content in the
third field of some other line , save the 1st field, get that line's 4th field and so on till
I reach DNA in the 4th field.
I have already developed part of the script which does that. But I am not sure how to handle, when I search for 4th field content in 3rd field, if it has more than one occurance.
I am getting the below output:
Expected output for the above example:
Could some one plz help me with this logic approach with unix script.
Thanks in Advance
Last edited by Franklin52; 10-11-2013 at 10:20 AM..
Reason: Please use code tags
Why don't you post your script that solves part of the problem, and why don't you specify correctly and in detail? e.g. the 32 at the start of each solution comes from where? SNA, I know, but don't leave us guessing. Also, you should clearly state that ALL four solutions are needed, i.e. duplicates in $3 are equivalent.
--------------------------------------------------------------------------
input files for above function are datalins1.dat and source.dat
output files for above function is complins.dat
-----------------------------------------------------------------------------
Field Seperator: `~
The concept is to start with SNA in the 3rd Field.
Fetch the 4th field, search that 4th field content in the
third field of some other line , save the 1st field, get that line's 4th field and so on till
I reach DNA in the 4th field.
I have already developed part of the script which does that. But I am not sure how to handle, when I search for 4th field content in 3rd field, if it has more than one occurance.
------------------------------------------------------------------
Expected output for the above example:
-------------------------------------------------------------------
the function works perfectly if we have single number in $4 of datalins1.dat for same value in $1
Could some one plz help me with this logic approach with unix script.
yes the file (datalins1.dat) could be much larger......not necessary only 12 lines(for the above example only 12 lines).....but the format of the file would be always constant ( four fields separated by delimiter `~ )...
What do you consider "much larger"? A hundred lines? A thousand? A million? A billion? A simple solution may scale from 12 to 1000, but perhaps not to a million and beyond.
It would be a shame for someone to waste their time crafting code that can never be used because it takes forever to complete or because it requires more memory than the system has available. So, please, be more precise than "much larger". Also, if the file can approach the size of your system's memory, you should definitely mention that.
Sorry for the inconvenience......much larger doesn't meant here that it can go to thousand or million lines...the above code is crafted on the basis of similar kind(datalins1.dat) of input scenario...
Hi all,
I am trying to find a way to change first letter in a word from lower case to upper case. It should be done for each first word in text or in paragraph, and also for each word after punctuation like
. ; : ! ?I found the following command
sed -i 's/\s*./\U&\E/g' $@ filenamebut... (7 Replies)
complinagetest () #function name
{
if ;then
rm complins.dat
fi
touch complins.dat
i=0
while read line
do
if ; then
va=`grep -w "$line" datalins1.dat | awk BEGIN'{FS="\`~"}{if ( $3=="'$line'" ) {print $4}}'`
i=$(($i+1))
varits=$(echo $va|awk -v varif="$i" '{print... (1 Reply)
Hello All,
I have code as follows :-
while true do
{opening a case1 statement}
1)
{opening another case2 statement}
{closing case 2}
2)
Showing error for "2)" as Syntax error at line 59 : `)' is not expected.
*)
{closing case 1}
... (5 Replies)
Hello Unix Gurus :
It would be really appreciative if can find a solution for this .
I have records in a file .
I need to Capitalize the records based on condition .
For Example i tried the following Command
COMMAND -->
fgrep "2000YUYU" /export/home/oracle/TST/data.dat | tr '' ''... (12 Replies)
Hi
I want to make string substitution ignoring case for search but respecting case for subtitute. Ex changing all occurences of "original" in a file to "substitute":
original becomes substitute
Origninal becomes Substitute
ORIGINAL becomes SUBSTITUTE
I know this a little special but it's not... (1 Reply)
Hi all,
i have a data array as followes.
ARRAY=DFSG345GGG
ARRAY=234FDFG090
ARRAY=VDFVGBGHH
so on..........
i need all english letters to be change to lower case. So i am expecting to see
ARRAY=dfsg345ggg
ARRAY=234fdfg090
ARRAY=vdfvgbghh
so on........
If i have to copy this data in... (8 Replies)
Hi Gurus,
I had a question regarding avoiding duplicates.i have a file abc.txt
abc.txt
-------
READER_1_1_1> HIER_28056 XML Reader: Error occurred while parsing:; line number ; column number
READER_1_3_1> Sun Mar 23 23:52:48 2008
READER_1_3_1> HIER_28056 XML Reader: Error occurred while... (0 Replies)
HELLO ALL,
URGENTLY NEEDED A SCRIPT TO SELECT AND DELETE LOWER AND MIXED CASE RECORDS FROM A COLUMN IN A TABLE.
FOR EXAMPLE : Table name is EMPLOYEE and the column name is CITY
and the CITY column records will be: Newyork
washington
... (1 Reply)