Questions tagged [ifs]

IFS is a variable in Unix shells (Bourne, POSIX sh, bash, ksh, …) that controls how unescaped substitutions are split into words.

IFS (short for "input field separator" and often referred to as "internal field separator") is a variable in Unix shells (, , , , , , , , …) that controls how strings are split into multiple fields. Most notably, variable substitutions (e.g. $foo) which are not inside double quotes or in a few other protected locations are split into multiple fields based on the value of IFS; the same goes for command substitutions (e.g. $(foo)). Each character that is present in IFS is a field separator. The default value contains a space, a tab and a newline.

For other meanings of the acronym IFS, use the appropriate tag:

  • IBM Integrated file system
  • QNX Image Filesystem
  • ERP by Industrial and Financial Systems AB
293 questions
1
vote
3 answers

How to use IFS in bash for an array of strings?

Given an array of strings, I want IFS to parse each string by an underscore, join the first three separated values together using the same delimeter and output them to an empty list. For instance, if I have the array…
1
vote
1 answer

Possible in one formula in google sheets?

I'm new to formulas in google sheets but doing ok with online learning. I have come across something I need to do that I cant find a solution for. I have this that works: =if(O13>=Q14,O13-INFO!L5*O13,0) But now I need to also include a cap to the…
1
vote
1 answer

How do I conditionally sum a cell based on the value of another cell?

I have a terrible formula that looks like this: =if(B17="Yes",B$7)+if(C17="Yes",C$7)+if(D17="Yes",D$7)+if(E17="Yes",E$7)+if(F17="Yes",F$7) I'd also like to be able to expand it if I go longer than column F. Basically, other people can change their…
Vill Ain
  • 13
  • 4
1
vote
1 answer

How to combine these two if statements for Google Sheets

I want to combine these two if statements so that the cell returns "Home" if C1=E1, "Not Home" if C1<>E1, but ignores blank cells, so the cell returns blank if either C1 or E1 is blank. =if(AND(C1=E1, C1<>"", E1<>""),"Home","") =if(AND(C1<>E1,…
1
vote
1 answer

Google Sheets IFS statement for currency conversion based from same document cell queries

UPDATE #2 So after some searching, I've found a statement to convert the other currencies (COP & USD) to CAD based on the historical DATE value using the following: =H85*average(index(GOOGLEFINANCE(CONCATENATE("CURRENCY:" & G85 & "CAD"), "price",…
Ty Snaden
  • 13
  • 3
1
vote
1 answer

IFS has mismatched range sizes. Expected row count: 1. column count: 1. Actual row count: 1000, column count: 1

My formula is as follows: =ARRAYFORMULA(IFS(AND(H2:H >= -B39, H2:H <= B40), 100, H2:H > B37, 0)) However this line keeps throwing the error: IFS has mismatched range sizes. Expected row count: 1. column count: 1. Actual row count: 1000, column…
Waltari
  • 1,052
  • 1
  • 30
  • 64
1
vote
2 answers

Forumula IFS 1*1=1

Im looking for someone to get me a full explanation about what exactly does 1*1=1 in the following formula. =IFS(L72=I71,"YES",L72=J71,"YES",L72=K71,"YES",1*1=1,"NO")
mau
  • 185
  • 11
1
vote
1 answer

Google Sheets: IFS statement wont return date

I'm currently using the following formula: =IFS(regexmatch(A2,"Malaysia"), B2-dataset!B3,REGEXMATCH(A2,"Saudi Arabia"), B2-dataset!B7,REGEXMATCH(A2,"Taiwan"), B2-dataset!B11,REGEXMATCH(A2,"Russia"), B2-dataset!B15,REGEXMATCH(A2,"Greece"),…
1
vote
2 answers

Return different values depending on if a value is between numbers in Google Sheets

I have a value, let's say 138. I need a way to check what % it corresponds to. In this case 138 is between 135 and 164 so it must return 34%. If value is less than 75 return 0%. If value is more than 285 return max which is 60%. Everything is in the…
Pau Serrat
  • 11
  • 3
1
vote
2 answers

Use IFS$'\n' to read -r jq into multiple variables

I currently have the following code which works as I want it to. foo=' [{ "name": "e2e (control-plane, true, true, true, ipv4, IPv4, true, false)", "failed_step": { "name": "Run Tests", "conclusion": "failure", …
user16541120
1
vote
4 answers

Pipe multiple jq values to "while read -r" loop

I am trying to find a clean way to assign 2 json string values to 2 variables within a while loop. The loop and input I am working with are as follows. INPUT: foo=' [ { "name":"name string (more info)", "nested_name":{ …
user16541120
1
vote
1 answer

Combine data from multiple IF Functions into one cell

I'm looking to create a product SKU by combining the data from columns B, I and K into an SKU in column N). I've managed to combine 'I' and 'K' using the function below but would now like to combine this function with the product title in column B.…
Tom
  • 159
  • 14
1
vote
2 answers

Google Sheets - Combine multiple IF Functions into one cell

I'm trying to produce a SKU in Google Sheets for a product using the values of three variants (Title, Colour and Size) The product is 'Lightweight trainers' with colour variants of 'Red' and 'Blue', and the sizes range from 5 - 12. Link to…
Tom
  • 159
  • 14
1
vote
0 answers

java.io.File.isFile() returning false on a mapped drive file, however cmd is able to list the contents

Created a Mapped Drive [Z:], which is created against a IBMi share by the command NET USE Z: \IBMiMachine\PROD /USER:USER1 ******* The drive is created successfully. Then tried to list all files (e.g. .php/.txt/.html etc) present under the mapped…
Kishore_2021
  • 645
  • 12
  • 38
1
vote
1 answer

Shell, IFS, read and tabulation

I'm trying to read a TSV file in a shell script, and found that when IFS is set to tabulation, read skip null values. An exemple is better than 1000 word: $ echo -e "a\tb\tc" | while IFS=$'\t' read v1 v2 v3; do echo "$v1 - $v2 - $v3"; done a - b -…
radius
  • 540
  • 1
  • 6
  • 14