Questions tagged [array]
The array tag has no usage guidance.
234
questions
27
votes
2
answers
113k
views
How to count the number of elements in an array in Ansible?
An array is generated in Ansible from shell command output, it is similar to below:
foo: [value0, value1, value2, value3]
Now depending on output of the shell command, the number of elements of foo ...
23
votes
6
answers
141k
views
Test if element is in array in bash
Is there a nice way of checking if an array has an element in bash (better than looping through)?
Alternatively, is there another way to check if a number or string equals any of a set of predefined ...
8
votes
3
answers
17k
views
How do I merge an array of images into a single giant image?
I have 220 png images of equal height and width with the following naming convention:
A1.png, A2.png, ... V9.png, V10.png
I need to merge them into one giant image, with A1 being the top left corner, ...
7
votes
2
answers
8k
views
Extract values from a range that are missing from another
I've got two columns in Excel, "ROSTER" and "PRESENT", shown below:
Is there a formula to achieve the "NOT HERE" column? I tried using VLOOKUP() and https://superuser.com/a/289653/135912 to no avail =...
6
votes
4
answers
34k
views
Excel INDEX MATCH Checking Multiple Columns
The problem I'm essentially trying to solve is a VLOOKUP that is checking Columns A:E for a value, and returning the value held in Column F should it be found in any of these.
With VLOOKUP not being ...
6
votes
3
answers
2k
views
Spawning multiple parallel wgets and storing results in a bash array to be pretty printed when all wgets are done
I have a long list of urls on my own website listed in a carriage return seperated text file. So for instance:
http:/www.mysite.com/url1.html
http:/www.mysite.com/url2.html
http:/www.mysite.com/url3....
6
votes
2
answers
924
views
Use functions like Countif, Countblank etc. to refer to discontiguous ranges.
Is there a way to use array formulas or some other feature to essentially have an excel function that means.
=Countblank({A1,A4:A6,A112:127,B29:B38}) etc.
Essentially, I want to refer to multiple ...
5
votes
1
answer
3k
views
ZSH iterate through string array containing spaces
I am trying to write a ZSH script which will iterate through a series of strings that contain spaces.
First, I'll set -A the array:
set -A a "this is" "a test" "of the" &...
4
votes
1
answer
1k
views
How to map one array element which is separated by newlines into a new array with multiple elements
I select 4 files in Nemo in the path /home/myUsername/.local/share/nemo/scripts/Folder with spaces/. Nemo stores the file paths in the environment variable NEMO_SCRIPT_SELECTED_FILE_PATHS.
(As you ...
4
votes
2
answers
61k
views
List values based on criteria
I have a table on a worksheet called "DealSetup" that looks like this simplified version:
A B
1 John Doe 1
2 Jane Doe 1
3 Mark Doe 2
4 Doug Doe 1
5 Mary Doe 2
I have ...
3
votes
1
answer
320
views
Debian Bash Associative Array Self (Internal) Referencing
I'm attempting to contruct an associative array where key-value pairs within the array, reference other key-value pairs in the same array, using Debian Gnu-Linux 12.4, 22.12.3 and Bash 5.2.15.
Example,...
3
votes
1
answer
22k
views
how to get the array size in ms excel?
I would like to write a formula which returns the size of an array. something like
size(A1:A50)
Maybe, it seems to be strange; but it helps me when I insert some new rows in the first 50 lines and ...
3
votes
3
answers
23k
views
MS Excel: Sumproduct only visible rows (use sumproduct with subtotal(9,array))
Pretty straightforward.
I want to use a SUMPRODUCT but only for visible rows.
I've tried =SUMPRODUCT(A2:A10, SUBTOTAL(9,B2:B10)) ... didn't work, even as an array formula.
I'm probably missing ...
3
votes
1
answer
2k
views
Make an array formula in excel calculate only on active rows
When excel calculates formulas over a column (e.g. a lookup), it's smart enough to only calculate until the last active row, rather than also running on all the blank rows.
With array formulas, it ...
3
votes
1
answer
13k
views
Pass arguments of .BAT file to executed .EXE file [duplicate]
I need a DOS .bat script that just transfers ALL arguments to a .exe program.
For example the DOS script main.bat that calls the .exe program.exe:
program.exe ????
The question is what ??? should ...
3
votes
1
answer
4k
views
Append string to array elements and join them in one expression
Let's assume I have an array
> words=(foo bar baz)
Now I can join the elements
> echo ${(j., .)words}
foo, bar, baz
And I can append a string to the elements:
> echo ${^words}yeah
...
3
votes
2
answers
1k
views
How to highlight boundaries of an array in Excel?
I'd like to know if there's a way to make excel show me where are the boundaries of an array, like the highlight I made in the picture below.
Some explanation: I have a worksheet that is full of ...
3
votes
2
answers
5k
views
Expand Synology SHR volume with varying disk sizes
I'm looking for a clarification on SHR and how it handles expanding a volume when the volume contains varying disk sizes.
I've read the Synology Documentation and it still isn't clear, because their ...
3
votes
2
answers
5k
views
Word macro: how to replace strings in a text, based on a 2 column-table?
So I have a series of strings that I'd like to search and replace in Word documents.
My strings would be displayed as a two-column table. I'd probably create the table with Word, then would convert ...
3
votes
1
answer
2k
views
How can you find the index of a word in a list in GNU make?
I want to be able to have multiple lists in make, all the same size, one of which contains filenames and the others containing info related to those files, in the same respective order. I want to be ...
3
votes
0
answers
164
views
Is there a good way to write a shell script compatible with both bash and zsh that addresses array elements?
The fact that bash is 0-indexed and zsh is 1-indexed can cause problems. For example the following will work as intended with bash, but not zsh (PS I am aware that I don't NEED to use an array for ...
3
votes
1
answer
288
views
Excel VBA: Application.Tranpose on an array gives Run-time error 438
I have a VBA code that gets data from a column of a structured table and puts it in a column of another structured table like this:
Dim TopNTickers As Variant
Dim NoOfTickers As Integer
Dim ...
3
votes
2
answers
3k
views
Excel, how to use text functions on lookup array without putting in another column?
If I'm using a vlookup, or a match function but I need to do some mumbo jumbo on my lookup material, is there a way of doing this in the lookup array without simply adding another column?
Let's say I ...
2
votes
2
answers
2k
views
In Excel, can I "splice" multiple Dynamic/Spilled Arrays into a single Dynamic/Spilled Array?
IN A NUTSHELL
I have four (say) columns of data, each a Dynamic/Spilled Array. I'd like to "stack" them into another column so as to produce a single Dynamic/Spilled Array comprising the "splice" of ...
2
votes
2
answers
15k
views
Is there a way to use a name range as an array criteria for a sum(countif()) formula in Excel 2010
Picture column A full of comments like feedback from a survey question. Now picture column B with a formula which counts occurrances of particular key words within each comment. I am currently using ...
2
votes
2
answers
7k
views
Excel MEDIAN across ARRAY with multiple conditionals using IF and AND functions
I want to determine a MEDIAN of values in one column based on meeting conditions in two other columns. I'm using MS Excel.
I know I have to process the MEDIAN function as an ARRAY (ctrl + shft + enter)...
2
votes
1
answer
108
views
What type of port is this?
What type of port is this? It is on the back of an older (circa 2006) EMC Array.
2
votes
1
answer
4k
views
How to return first non-blank cell and if it's already a value before it, return the third non-blank and so on?
How to make a function which would return the first non-blank cell value but if it's defined in the left cells next to it, it would jump 2 cells and look for the next value.
Table:
1 | 2 | 3 | 4 | ...
2
votes
1
answer
16k
views
Add hashes with duplicate keys to array
I have a bunch of hashes in powershell with identical keys. Though creating an array of hashes with different keys is straightforward and thoroughly discussed on the internet, I'm unable to find any ...
2
votes
2
answers
455
views
bash for loop with unknown array
I need to execute a for loop over the elements in array edg_cdi, but I know it is that array just because my input parameter is chosen='cdi'. If it was chosen='cdt' (or many others) the selected array ...
2
votes
2
answers
236
views
Using GCD Function With Arrays in Excel
I'm having trouble determining GCD from a dataset. I'm trying to determine the quantity of items in a box of any given item in a warehouse without physically looking at each item on the shelves.
...
2
votes
1
answer
2k
views
Excel Formula To Show Top X Percentage Of An Array
Using the simple data set below, starting in A1, with headers:
Order Time
a 1
b 1
c 2
d 4
e 4
f 5
g 6
h 7
i 500
j 600
I want to know in ...
2
votes
1
answer
427
views
Average by month within multiple bespoke date ranges excel
I have data by month from January 2013 -> October 2017 as such
MONTH MY DATA
Jan-13 45.0
Feb-13 23.0
.
.
.
Oct-17 98.4
I wish to average data by calendar month, for specific, non-...
2
votes
1
answer
1k
views
Using an array as search criterea for find command
I'm wondering if it's possible to declare an array of file types to then be searched with via the find command?
So
fileTypes=(*.omf *.jpeg *.xml *.otf)
find . -name ${fileTypes}
Instead of:
find ....
2
votes
2
answers
1k
views
How to flag rows with the pattern non-blank, blank, non-blank using Excel
I would like your help with something I have been trying to figure out for the past two days.
I have data with 1000's of rows and several columns. I want to insert a column with a (array) formula ...
2
votes
1
answer
1k
views
Display Associative array in awk
How can I display Associative array, when I don't know index?
My script:
{
tab[$1]=tab[$1]+1
}
END{
print tab[*]#display array -> it doesn't work
}
2
votes
1
answer
5k
views
Excel 2010 - Need to sum dynamic range based on trailing 3 months
I am trying to sum a dynamic range for a list of entries 3 months before and 3 months after a specific month. I think I need to use an array to get this, but I'm not able to find what I need to do.
...
2
votes
1
answer
1k
views
Batch: Unable to assign an array to a variable
I am not able to assign an array to a variable:
set persons[0].FirstName=Richard
set persons[0].lastName=DuponT
set persons[1].FirstName=Romain
set persons[1].lastName=DuponD
set x=0
REM Works:
call ...
2
votes
2
answers
4k
views
CTRL+SHFT+ENTER Array Formula not working
So my issue is a more complex one, but I have tried with a much simpler formula (with a similar case) and I get the same problem. The array formula I'm using only returns the results for the first ...
2
votes
1
answer
443
views
Trying to create a formula to calculate a rate value per row in Excel
I think this is to do with a formula over an array but I can’t get it to work.
I’m looking for the easiest method to do the following.
Say I have this setup, columns are 'jobs' and rows are '...
2
votes
2
answers
960
views
How to return multiple match results and output them to a cell as concatenated text?
Suppose I have the following data:
A
B
C
D
1
val1
Str1
2
ValM
Str2
3
val2
Str3
4
ValM
Str4
5
ValM
Str5
6
val3
Str6
7
ValM
Str7
8
val4
Str8
9
val5
Str9
10
ValM
Str10
I would like to:
find ...
2
votes
0
answers
24
views
Efficient way to concatenate row titles based on column indicator?
I have a list of ingredients in column A, and different products in columns. The products all consists of different combinations of the same ingredients. In each product's column, there are Y ...
2
votes
1
answer
71
views
Adding arrays to a timeline and summing them [closed]
I am trying to add multiple arrays to a simple timeline and then summing those arrays. This is a simplified view:
A = 1 2 3 4 5
timeline 0 1 2 3 4 5 6 7 8 9 ...
2
votes
1
answer
2k
views
Using powershell, how two screenshots can be compared in buffer?
I found this snippet that is working well in a loop for me to take screenshot per minute. I could hash results and compare the two latest screenshots for changes by following this post: (Get-FileHash $...
2
votes
1
answer
3k
views
Find position of first uppercase character in excel string
I need to find the position of the first uppercase character in an Excel string. There are lots of resources on the web that have the same (or effectively the same) solution for this:
=MIN(IF(ISERROR(...
2
votes
2
answers
2k
views
copy array in a batch file
I have several files located across several directories/subfolders that I need to copy to several destinations. I currently do this using xcopy but I do it line by line, so there are several lines of ...
2
votes
0
answers
20
views
Mac OSX Excel 2016
I have a list of invoice lines. Each invoice line has a supply number and this can be repeated as many times as there are invoices. Each line has a from and end date for the supply and a consumption ...
2
votes
1
answer
620
views
How to count number of cells over multiple worksheets whose values are in between a given range?
I have an Excel workbook with numerous worksheets containing data like:
'DATA_1' 'DATA_2' 'DATA_3'
A B A ...
2
votes
1
answer
3k
views
BASH associative array rearrange keys
I am running into a weird issue with associative arrays in bash.
I have the following files in a directory:
ls -lart
drwxr-xr-x. 3 root root 4096 Feb 9 11:14 ..
-rw-r--r-- 1 root root 3275 Feb 9 ...
2
votes
0
answers
215
views
How to switch off "you can use new shorter array creation syntax" hint in NetBeans IDE 8.0.2?
I use NetBeans IDE 8.0.2 on Linux Mint.
I searched through the options few times, but I can never find the option to switch this hint off in there.
I know well about the new syntax in PHP, but I don'...