Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Intersection by part of the string Post 302897030 by a_bahreini on Thursday 10th of April 2014 02:16:28 PM
Old 04-10-2014
hmmm, that's weird! There might be something wrong with my files. This is the first ten lines for each file.
File
Code:
PROPRIETARYNAME^IPHARM_CLASSES$
AMYVID^I"Radioactive_Diagnostic_Agent_for_Positron_Emission_Tomography_[EPC],Positron_Emitting_Activity_[MoA]"$
QUINIDINE_GLUCONATE^I"Antiarrhythmic_[EPC],Cytochrome_P450_2D6_Inhibitor_[EPC],Cytochrome_P450_2D6_Inhibitors_[MoA]"$
AXIRON^I"Androgen_[EPC],Androgen_Receptor_Agonists_[MoA],Androstanes_[Chemical/Ingredient]"$
PROZAC^I"Serotonin_Reuptake_Inhibitor_[EPC],Serotonin_Uptake_Inhibitors_[MoA]"$
STRATTERA^I"Norepinephrine_Reuptake_Inhibitor_[EPC],Norepinephrine_Uptake_Inhibitors_[MoA]"$
STRATTERA^I"Norepinephrine_Reuptake_Inhibitor_[EPC],Norepinephrine_Uptake_Inhibitors_[MoA]"$
STRATTERA^I"Norepinephrine_Reuptake_Inhibitor_[EPC],Norepinephrine_Uptake_Inhibitors_[MoA]"$
SYMBYAX^I"Atypical_Antipsychotic_[EPC],Serotonin_Reuptake_Inhibitor_[EPC],Serotonin_Uptake_Inhibitors_[MoA]"$
SYMBYAX^I"Atypical_Antipsychotic_[EPC],Serotonin_Reuptake_Inhibitor_[EPC],Serotonin_Uptake_Inhibitors_[MoA]"$

File2
Code:
DRUG^IInteraction_Type^ISource^IGene_Symbol$
BACITRACIN^Iinhibitor^IDrugBank^IA2M$
BECAPLERMIN^In/a^IDrugBank^IA2M$
GIBBERELLIN_A4^In/a^IDrugBank^IAADACL2$
GIBBERELLIN_A3^In/a^IDrugBank^IAADACL2$
PYRIDOXAL_PHOSPHATE^Icofactor^IDrugBank^IAADAT$
L-GLUTAMIC_ACID^In/a^IDrugBank^IAADAT$
L-ALANINE^In/a^IDrugBank^IAARS$
L-ALANINE^In/a^IDrugBank^IAARS2$
N-(5-AMINO-5-CARBOXYPENTYL)GLUTAMIC_ACID^In/a^IDrugBank^IAASS$

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to get the last part of a string followed by a pattern

assuming "cat" is the pattern, string (regardless length) asdadfcat4 I need to get 4 for eirtrjkkkcat678- I'd get 678 (in b-shell) Thanks in advance!!! (4 Replies)
Discussion started by: bluemoon1
4 Replies

2. Shell Programming and Scripting

Find the intersection between two files

How can find the intersection between files for Example: file1 entry1 entry2 entry3 entry33 file2 entry2 entry4 entry5 . . . . the output should be entry2 (9 Replies)
Discussion started by: makrami
9 Replies

3. Shell Programming and Scripting

Getting part of a string

Hi, I have a string assinged to a varaible as below. FILE=/var/adm/message If $FILE is the value where it stores the path of message file. I would like to extract the location of the file message as below LOCATION=/var/adm FILE may have value like /var/adm/xxxx/message ... (2 Replies)
Discussion started by: raghu.amilineni
2 Replies

4. Shell Programming and Scripting

Part of a string

Hi mates, I am doing a script in ksh. I have the following string: /opt/one/two/four/five/myFile.txt And I have a variable: echo "${variable}" -> /opt/one/two/ I would like to have just the string: four/five/myFile.txt What is the better way to do that? Thanks in... (3 Replies)
Discussion started by: gonzaloron
3 Replies

5. Web Development

Intersection and union of array by hash

Hi, A piece of script from Perl-cookbook I do not understand, and post here for explanation. The purpose is to find the element in either array (union), and in both array (intersection). Thank you in advance. @a=qw(1 3 5 6 7 8); @b=qw(2 3 5 7 9); foreach $e (@a, @b) {$union{$e}++ &&... (3 Replies)
Discussion started by: yifangt
3 Replies

6. Shell Programming and Scripting

Need to take one part from a string

I have a string something like "/opt/src/default.cfg" OR /opt/src/common/one This whole string stored in an array. The problem is this string is not constant and it will keep on changing as lot of strings are stored in the array and it will be look like :- case 1 /opt/src/default.cfg ... (8 Replies)
Discussion started by: Renjesh
8 Replies

7. Shell Programming and Scripting

Deleting part of a string : string manipulation

i have something like this... echo "teCertificateId" | awk -F'Id' '{ print $1 }' | awk -F'te' '{ print $2 }' Certifica the awk should remove 'te' only if it is present at the start of the string.. anywhere else it should ignore it. expected output is Certificate (7 Replies)
Discussion started by: vivek d r
7 Replies

8. Shell Programming and Scripting

Finding intersection

Hi Friends, I would like to be helped for the following issue I am currently stuck with I have two files like the following tom ram 10 20 hey bye 11 12 bus cat 20 30 put but 25 30 jak mok 11 12 fil don 76 57 bus cat 23 45 pan ban 09 78 put but 45 67 kis mis 23 45 I would like... (2 Replies)
Discussion started by: jacobs.smith
2 Replies

9. UNIX for Dummies Questions & Answers

Intersection by specific columns

Hi, I'd like to intersect two files by the 4th col of the first file and 6th col of the second file. This is the code I use: awk 'NR==FNR{A;next}$6 File1 File2 However, this is only outputting the second file lines. I'd like to have both lines in a single line separated by a tab. Thanks in... (25 Replies)
Discussion started by: a_bahreini
25 Replies

10. Shell Programming and Scripting

Extracting a part of a string

Hi, I needed to extract some specific characters from a string based on user input. For example: After the script executes the user enters the following details: Please enter the string: This is a shell script Please enter the starting position: 11 Please enter the number of characters to be... (4 Replies)
Discussion started by: ChandanN
4 Replies
TABS(1) 						    BSD General Commands Manual 						   TABS(1)

NAME
tabs -- set terminal tabs SYNOPSIS
tabs [-n | -a | -a2 | -c | -c2 | -c3 | -f | -p | -s | -u] [+m[n]] [-T type] tabs [-T type] [+[n]] n1[,n2,...] DESCRIPTION
The tabs utility displays a series of characters that clear the hardware terminal tab settings then initialises tab stops at specified posi- tions, and optionally adjusts the margin. In the first synopsis form, the tab stops set depend on the command line options used, and may be one of the predefined formats or at regular intervals. In the second synopsis form, tab stops are set at positions n1, n2, etc. If a position is preceded by a '+', it is relative to the previous position set. No more than 20 positions may be specified. If no tab stops are specified, the ``standard'' UNIX tab width of 8 is used. The options are as follows: -n Set a tab stop every n columns. If n is 0, the tab stops are cleared but no new ones are set. -a Assembler format (columns 1, 10, 16, 36, 72). -a2 Assembler format (columns 1, 10, 16, 40, 72). -c COBOL normal format (columns 1, 8, 12, 16, 20, 55) -c2 COBOL compact format (columns 1, 6, 10, 14, 49) -c3 COBOL compact format (columns 1, 6, 10, 14, 18, 22, 26, 30, 34, 38, 42, 46, 50, 54, 58, 62, 67). -f FORTRAN format (columns 1, 7, 11, 15, 19, 23). -p PL/1 format (columns 1, 5, 9, 13, 17, 21, 25, 29, 33, 37, 41, 45, 49, 53, 57, 61). -s SNOBOL format (columns 1, 10, 55). -u Assembler format (columns 1, 12, 20, 44). +m[n], +[n] Set an n character left margin, or 10 if n is omitted. -T type Output escape sequence for the terminal type type. ENVIRONMENT
The LANG, LC_ALL, LC_CTYPE and TERM environment variables affect the execution of tabs as described in environ(7). The -T option overrides the setting of the TERM environment variable. If neither TERM nor the -T option are present, tabs will fail. EXIT STATUS
The tabs utility exits 0 on success, and >0 if an error occurs. SEE ALSO
expand(1), stty(1), tput(1), unexpand(1), termcap(5) STANDARDS
The tabs utility conforms to IEEE Std 1003.1-2001 (``POSIX.1''). HISTORY
A tabs utility appeared in PWB UNIX. This implementation was introduced in FreeBSD 5.0. BUGS
The current termcap(5) database does not define the 'ML' (set left soft margin) capability for any terminals. BSD
May 20, 2002 BSD
All times are GMT -4. The time now is 08:53 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy