06-29-2017
I see what was wrong. In my example data I foolishly included the line numbers from my file. Once I adjusted fields for this error it worked flawlessly.
Thank you so much RudiC and R. Singh.
If it is not too much trouble, would someone be kind enough to explain this code for me? I'm tracking fairly well but got confused when variable "q" is assigned to $2 but then is included in array A.
Last edited by jvoot; 06-29-2017 at 02:52 AM..
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I have two files. 1st file has 1 column (huge file containing ~19200000 lines) and 2nd file has 2 columns (small file containing ~6000 lines).
#################################
huge_file.txt
a
a
ab
b
##################################
small_file.txt
a 1.5
b 2.5
ab ... (4 Replies)
Discussion started by: AshwaniSharma09
4 Replies
2. Shell Programming and Scripting
Hi Experts,
I am very new to scripting and have a prb since few days and it is urgent to solve so much appreciated if u help me.
i have 2 files
file1.txt
9647810043118
9647810043126
9647810043155
9647810043161
9647810043166
9647810043185
9647810043200
9647810043203
9647810043250... (22 Replies)
Discussion started by: mustafa.abdulsa
22 Replies
3. Shell Programming and Scripting
Hi,
I have a file filled with search strings which have a blank in between and look like this:
S. g. Ehr.
o. Jg.
v. d. Chijs
g. Ehr.
Now i would like to search for the strings and it also shall return the next column after the match.
awk -v FILE="search_strings.txt" 'BEGIN {... (10 Replies)
Discussion started by: sdf
10 Replies
4. Shell Programming and Scripting
I have two files... file1 and file2.
Where columns 1 and 2 of file1 match columns 1 and 2 of file2 I want to create a new file that is all file1 + columns 3 and 4 of file2
:b: Many thanks if you know how to do this.... :b:
file1
31-101 106 0 92
31-101 106 29 ... (2 Replies)
Discussion started by: pelhabuan
2 Replies
5. Shell Programming and Scripting
I have a file with many lines which contain strings like .. etc.
But with no rule regarding field separators or anything else.
I want to print ONLY THE STRING from each line , not the entire line !!!
For example from the lines :
Flow on service executed with success in . Performances... (5 Replies)
Discussion started by: black_fender
5 Replies
6. Shell Programming and Scripting
Hello everyone,
Maybe somebody could help me with an awk script.
I have this input (field separator is comma ","):
547894982,M|N|J,U|Q|P,98,101,0,1,1
234900027,M|N|J,U|Q|P,98,101,0,1,1
234900023,M|N|J,U|Q|P,98,54,3,1,1
234900028,M|H|J,S|Q|P,98,101,0,1,1
234900030,M|N|J,U|F|P,98,101,0,1,1... (2 Replies)
Discussion started by: Ophiuchus
2 Replies
7. Shell Programming and Scripting
Hi experts,
I have a file with regexes which is used for automatic searches on several files (40+ GB).
To do some postprocessing with the grep result I need the matching line as well as the match itself.
I know that the latter could be achieved with grep's -o option. But I'm not aware of a... (2 Replies)
Discussion started by: stresing
2 Replies
8. Shell Programming and Scripting
Trying to use awk to match the contents of each line in file1 with $5 in file2. Both files are tab-delimited and there may be a space or special character in the name being matched in file2, for example in file1 the name is BRCA1 but in file2 the name is BRCA 1 or in file1 name is BCR but in file2... (6 Replies)
Discussion started by: cmccabe
6 Replies
9. UNIX for Beginners Questions & Answers
I've written an awk script to compare two fields in two different files and then print portions of each file on the same line when matched. It works reasonably well, but every now and again, I notice some errors and cannot seem to figure out what the issue may be and am turning to you for help.
... (2 Replies)
Discussion started by: jvoot
2 Replies
10. UNIX for Beginners Questions & Answers
I cannot seem to get what should be a simple awk one-liner to work correctly and cannot figure out why. I would like to use patterns from a specific field in one file as regex to search for matching strings in the entire line ($0) of another file.
I would like to output the lines of File2 which... (1 Reply)
Discussion started by: jvoot
1 Replies
LEARN ABOUT HPUX
nlist_ia
nlist_ia(3C) nlist_ia(3C)
NAME
nlist_ia: nlist(), nlist64() - get entries from name list on Integrity systems
SYNOPSIS
Command: [flag]... [library]...
Remarks
The use of symbol table type and value information is inherently nonportable. The use of or should reduce the effort required to port a
program that uses such information, but complete portability across all HP-UX implementations cannot be expected.
This manpage describes and for Itanium-based systems. For and on PA-RISC systems, see nlist_pa(3C).
DESCRIPTION
and have basically the same functionality and they can process SOM or ELF files. The structure is the same as and is used for source code
compatibility.
The or function examines the name list in the executable file whose name is pointed to by file_name, and selectively extracts a list of
values and puts them in the array of structures pointed to by nl. The array of structures initially contains only the names of variables.
Once the or function has been called, the variable names are augmented with symbol information. The list is terminated by a null name,
which consists of a null string in the variable-name position of the structure. The name list of the file is searched for each variable
name. If the name is found, the symbol's type, scope, and value in the file is inserted into the name list structure. If the file
searched is an ELF file, the section index is also inserted. For SOM files, the subspace index is inserted. The symbol value is 64-bit.
If the file searched is a SOM file, then the value field is zero padded. If the name is not found, the fields in the name list structure
are set to 0. The structures and are defined in the include file See a.out(4) and nlist(4) for further description of the symbol table
structure.
The file must have the organization and symbol table described for an file in a.out(4). The information is extracted from the symbol table
used by the linker, ld(1).
On machines that have such a file, this subroutine is useful for examining the system name list kept in file In this way programs can
obtain system addresses that are up to date.
RETURN VALUE
All structure fields are set to 0 if the file cannot be found or if it is not a valid object file containing a linker symbol table.
and return:
An error occurred.
Success.
WARNINGS
The header file is automatically included by for compatibility. However, including is discouraged if the only information needed from is
for use by or If is included, the line may need to follow it.
SEE ALSO
ld(1), elf(3E), a.out(4), nlist(4).
STANDARDS CONFORMANCE
Integrity Systems Only nlist_ia(3C)