01-10-2018
In fact, the "," overrides the SUBSEP character in the array index creation (as can do any character, e.g. <TAB>). I use this sometimes if I print out the array with inidices for debug purposes.
This User Gave Thanks to RudiC For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello!
I am writing a program to run through two large lists of data (~300,000 rows), find where rows in one file match another, and combine them based on matching fields. Due to the large file sizes, I'm guessing AWK will be the most efficient way to do this. Overall, the input and output I'm... (5 Replies)
Discussion started by: Michelangelo
5 Replies
2. Shell Programming and Scripting
Hi every one;
I have a 31500-line text file upon which two following tasks are to be performed:
1: Rearranging the file
2: Taking the average of each column (considering number of zeros) and output the result into a new file
This is the code I've come up with:
awk '(NR%3150<3150)... (0 Replies)
Discussion started by: nxp
0 Replies
3. Shell Programming and Scripting
Hi All,
I have 2 files (file1 & file2).
File1 and File2 have m and n columns respectively
I have to compare value in column1 of file1 with file2 and find line(s) from file2 matching column1 value.
The value can be in any column in the matching lines of file2.
The output should be... (10 Replies)
Discussion started by: Swagi
10 Replies
4. Shell Programming and Scripting
I am newbie to unix and would please like some help to solve the task below
I have two files, file_a.text and file_b.text that I want to evaluate.
file_a.text
1698.74
1711.88
6576.25
899.41
3205.63
4187.98
697.35
1551.83 ... (3 Replies)
Discussion started by: gameli
3 Replies
5. Shell Programming and Scripting
Hi,
I am working with two tab-delimited files with multiple columns, formatted as follows:
File 1:
>chrom 1 100 A G 20 …(10 columns)
>chrom 1 104 G C 18 …(10 columns)
>chrom 2 28 T C ... (4 Replies)
Discussion started by: mbp
4 Replies
6. Shell Programming and Scripting
Hi,
Please excuse for often requesting queries and making R&D, I am trying to work out a possibility where i have two files field separated by pipe and another file containing only one field where there is no matching columns, Could you please advise how to merge two files.
$more... (3 Replies)
Discussion started by: karthikram
3 Replies
7. Shell Programming and Scripting
Hi everyone,
Given two files (test1 and test2) with the following contents:
test1:
80263760,I71
80267369,M44
80274628,L77
80276793,I32
80277390,K05
80277391,I06
80279206,I43
80279859,K37
80279866,K35
80279867,J16
80280346,I14and test2:
80263760,PT18
80279867,PT01I need to do some... (3 Replies)
Discussion started by: gacanepa
3 Replies
8. UNIX for Beginners Questions & Answers
Hi,
I have 2 tab-delimited input files as follows.
file1.tab:
green A apple
red B apple
file2.tab:
apple - A;Z
Objective:
Return $1 of file1 if,
. $1 of file2 matches $3 of file1 and,
. any single element (separated by ";") in $3 of file2 is present in $2 of file1
In order to... (3 Replies)
Discussion started by: beca123456
3 Replies
9. Shell Programming and Scripting
Long time listener first time poster. Hope someone can advise.
I have two files, 1000+ lines in each, two fields in each file.
After performing a sort, what is the best way to find exact matches where field $1 and $2 in file1 are also present in file2 on the same line, then output only those... (6 Replies)
Discussion started by: bstaff
6 Replies
10. UNIX for Beginners Questions & Answers
Hello all, I am having trouble with what should be an easy task, but seem to be missing something fundamental. I have two files, with File 1 consisting of a single field of many thousands of records. I also have File 2 with two fields and many thousands of records.
My goal is that when $1 of... (2 Replies)
Discussion started by: jvoot
2 Replies
LEARN ABOUT OSX
xpc_array_create
xpc_array_create(3) BSD Library Functions Manual xpc_array_create(3)
NAME
xpc_array_create -- creation and management of XPC arrays
SYNOPSIS
#include <xpc/xpc.h>
xpc_object_t
xpc_array_create(const xpc_object_t *objects, size_t count);
void
xpc_array_set_value(xpc_object_t array, size_t index, xpc_object_t value);
void
xpc_array_append_value(xpc_object_t array, xpc_object_t value);
xpc_object_t
xpc_array_get_value(xpc_object_t array, size_t index);
size_t
xpc_array_get_count(xpc_object_t array);
bool
xpc_array_apply(xpc_object_t array, xpc_array_applier_t applier);
void
xpc_array_set_bool(xpc_object_t array, size_t index, bool value);
void
xpc_array_set_int64(xpc_object_t array, size_t index, int64_t value);
void
xpc_array_set_uint64(xpc_object_t array, size_t index, uint64_t value);
void
xpc_array_set_double(xpc_object_t array, size_t index, double value);
void
xpc_array_set_date(xpc_object_t array, size_t index, int64_t value);
void
xpc_array_set_data(xpc_object_t array, size_t index, const void *bytes, size_t length);
void
xpc_array_set_string(xpc_object_t array, size_t index, const char *value);
void
xpc_array_set_uuid(xpc_object_t array, size_t index, const uuid_t value);
void
xpc_array_set_fd(xpc_object_t array, size_t index, int value);
void
xpc_array_set_connection(xpc_object_t array, size_t index, xpc_connection_t value);
bool
xpc_array_get_bool(xpc_object_t array, size_t index);
int64_t
xpc_array_get_int64(xpc_object_t array, size_t index);
uint64_t
xpc_array_get_uint64(xpc_object_t array, size_t index);
double
xpc_array_get_double(xpc_object_t array, size_t index);
int64_t
xpc_array_get_date(xpc_object_t array, size_t index);
const void *
xpc_array_get_data(xpc_object_t array, size_t index, size_t *length);
const uint8_t *
xpc_array_get_uuid(xpc_object_t array, size_t index);
const char *
xpc_array_get_string(xpc_object_t array, size_t index);
int
xpc_array_get_fd(xpc_object_t array, size_t index);
xpc_connection_t
xpc_array_get_connection(xpc_object_t array, size_t index);
ARRAYS
XPC arrays are collections of XPC objects ordered by index. The index is zero-based. XPC arrays are contiguous, and values must exist at all
indexes between zero and the greatest index of the array. A hole in the array can be simulated by using a null object as returned by
xpc_null_create(3).
CREATION
The xpc_array_create() function returns a newly created array. The caller may optionally provide objects, a C array of XPC object references,
to initialize the array. The count is used to specify the size of the C array. If objects is NULL, then count must be zero. If count speci-
fies more elements than are actually present in values or if values is NULL and count is non-zero, the behavior is undefined.
GETTING AND SETTING VALUES
The xpc_array_append_value() function may be used to append a value to the end of an array. This operation increases the count of the values
in the array by one.
The value of a specific index in the array may be set using the xpc_array_set_value() function. The value must be non-NULL, and the index
must already exist (i.e. less than the count provided at creation or extended through previous append operations).
The value at a specific index of an array may be retrieved using the xpc_array_get_value() function. The result of getting a non-existing
index (i.e. one that was not specified at creation or through a previous append operation) in undefined.
PRIMITIVE GET AND SET FUNCTIONS
Various functions exist for retrieving primitive C and operating system types directly from an array without the need for an intermediate
boxed object. See xpc_object(3) for more information.
The special XPC_ARRAY_APPEND constant may be used to append a value to the end of the array instead of operating on a specific index.
SEE ALSO
xpc_object(3), xpc_objects(3), xpc_dictionary_create(3)
Darwin 1 July, 2011 Darwin