Questions tagged [array]
226 questions
24
votes
2 answers
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 may vary.
I then generate a jinja2 template to…
frenchy59
- 343
- 1
- 2
- 4
21
votes
6 answers
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 constants?
Tgr
- 2,953
- 4
- 26
- 31
8
votes
3 answers
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, letters increasing horizontally and numbers…
SubTea
- 81
- 1
- 1
- 2
7
votes
2 answers
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 =(
Any help would be appreciated!
Thanks!
Kevin Hua
- 300
- 2
- 13
6
votes
2 answers
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 locations where you would normally type a…
Some_Guy
- 744
- 3
- 12
- 36
6
votes
3 answers
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.html
I need to spawn a number of parallel wgets…
Brad
- 195
- 4
6
votes
4 answers
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 up to the task I have looked into the INDEX-MATCH…
Richard Allan
- 83
- 1
- 1
- 11
4
votes
2 answers
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 a table on a worksheet called "List" that I would…
drumichael611
- 43
- 1
- 1
- 4
4
votes
1 answer
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" "emergency broadcast system"
From here, I'll try to iterate through it using a…
Benjamin Dennison
- 141
- 7
4
votes
1 answer
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 can see in the answer from glenn jackman below,…
stackunderflow
- 115
- 1
- 8
3
votes
1 answer
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 seems this behaviour changes, and it calculates over…
Some_Guy
- 744
- 3
- 12
- 36
3
votes
2 answers
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 arrays everywhere, and sometimes I have to insert a…
GabrielF
- 143
- 5
3
votes
2 answers
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 have a lookup value of "FOOBAR 123" and I want to…
Some_Guy
- 744
- 3
- 12
- 36
3
votes
2 answers
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 use-case assumes that the original volume was…
rabhw
- 31
- 1
- 4
3
votes
2 answers
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 it manually to TXT, or CSV or whatever would…
Paulie
- 66
- 1
- 5