08-14-2016
Okay, but why does it only have issues when one file is larger than the other, but works fine the other way around? This is the case for both sets of code that you had. Any hints as to why?
Where can I actually attach my "real" files to this forum?
I will try a few things now. Thanks!
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi, i've two files (file1, file2) i want to take value (in column1) and search in file2 if the they match print the value from file2.
this is what i have so far.
awk 'FILENAME=="file1"{ arr=$1 }
FILENAME=="file2"
{print $0}
' file1 file2 (2 Replies)
Discussion started by: myguess21
2 Replies
2. Shell Programming and Scripting
Hi,
I have file1 like this
aaa
ggg
ddd
vvv
eeeand file2
aaa 2
aaa 443
xxx 76
aaa 34
ggg 33
wee 99
ggg 33
ddd 1
ddd 10
ddd 98
sds 23 (4 Replies)
Discussion started by: polsum
4 Replies
3. UNIX for Dummies Questions & Answers
I have very limited coding skills but I'm wondering if someone could help me with this. There are many threads about matching strings in two files, but I have no idea how to add a column from one file to another based on a matching string.
I'm looking to match column1 in file1 to the number... (3 Replies)
Discussion started by: pathunkathunk
3 Replies
4. Shell Programming and Scripting
I have a file containing texts and indexes. I need the text between (and including ) INDEX and number "1" alone in line. I have managed this:
awk '/INDEX/,/1$/{if (!/1$/)print}' file1.txt
It works for all indexes.
And then I have second file with years and indexes per year, one per line... (3 Replies)
Discussion started by: phoebus
3 Replies
5. Shell Programming and Scripting
Hi.
How can we print those rows of file2 which are mentioned in file1. first character of file1 is a row number.. for eg
file1
1:abc
3:ghi
6:pqr
file2
a abc
b def
c ghi
d jkl
e mno
f pqr
... (6 Replies)
Discussion started by: Abhiraj Singh
6 Replies
6. Shell Programming and Scripting
I have two files.
File 1 is a two-column index file, e.g.
comp11084_c0_seq6:130-468(-) comp12746_c0_seq3:140-478(+)
comp11084_c0_seq3:201-539(-) comp12746_c0_seq2:191-529(+)
File 2 is a sequence file with headers named with the same terms that populate file 1. ... (1 Reply)
Discussion started by: pathunkathunk
1 Replies
7. Shell Programming and Scripting
I have a list of IDs in file1 and a list of sequences in file2. I can print sequences from file2, but I'm asking for help in printing the sequences in the same order as the IDs appear in file1.
file1:
EN_comp12952_c0_seq3:367-1668
ES_comp17168_c1_seq6:1-864
EN_comp13395_c3_seq14:231-1088... (5 Replies)
Discussion started by: pathunkathunk
5 Replies
8. Shell Programming and Scripting
Hi, I wanted to add each row of file2.txt to entire length of file1.txt given the sample data below and save it as new file. Any idea how to efficiently do it. Thank you for any help.
input file
file1.txt file2.txt
140 30 200006 141 32
140 32 200006 142 33
140 35 200006 142... (5 Replies)
Discussion started by: ida1215
5 Replies
9. Shell Programming and Scripting
I am trying to use awk to find all the $2 values in file2 which is ~30MB and tab-delimited, that are between $2 and $3 in file1 which is ~2GB and tab-delimited.
I have just found out that I need to use $1 and $2 and $3 from file1 and $1 and $2of file2 must match $1 of file1 and be in the range... (6 Replies)
Discussion started by: cmccabe
6 Replies
10. UNIX for Beginners Questions & Answers
This is a question that is related to one I had last August when I was trying to sort/merge two files by millsecond time column (in this case column 6).
The script (below) that helped me last august by RudiC solved the puzzle of sorting/merging two files by time, except it gets lost when the... (0 Replies)
Discussion started by: aachave1
0 Replies
LEARN ABOUT HPUX
setregid
setregid(2) System Calls Manual setregid(2)
NAME
setregid - sets the real and effective group IDs
SYNOPSIS
DESCRIPTION
sets the real and effective group IDs of the calling process.
Only a privileged process can set the real group ID and/or the effective group ID to any valid value. A nonprivileged process can set the
real group ID to the saved set-group-ID from one of the exec family of functions, or the effective group ID to either the saved set-group-
ID or the real group ID.
Any supplementary group IDs of the calling process remain unchanged.
Argument rgid is the read group ID value to be set with. If rgid is set to the real group ID is not be changed.
Argument egid is the effective group ID value to be set with. If egid is set to -1, the effective group ID is not changed.
The real and effective group IDs may be set to different values in the same call.
Security Restrictions
Some or all of the actions associated with this system call require the privilege (CHSUBJIDENT). Processes owned by the superuser will
have this privilege. Processes owned by other users may have this privilege, depending on system configuration.
See privileges(5) for more information about privileged access on systems that support fine-grained privileges.
RETURN VALUE
Upon successful completion is set to Otherwise, errno is set to indicate the type of error and neither group IDs are changed.
ERRORS
is set to one of the following values if the corresponding condition is detected.
The value of the
rgid or egid argument is invalid or out-of-range.
The process does NOT have all the appropriate privileges other
than to change the real group ID to the saved set-group-ID, or to change the effective group ID to either the real group ID
or the saved set-group-ID.
AUTHOR
was developed by the University of California, Berkeley and HP.
SEE ALSO
exec(2), geteuid(2), getgid(2), getuid(2), setegid(2), setgid(2), setreuid(2), setuid(2).
setregid(2)