SELECT * FROM (VALUES (1, 'A'), (2, 'b'), (3, 'C')) AS foo (num, title)Code language:SQL (Structured Query Language)(sql)
returns:
num
title
1
A
2
b
3
C
It is nice to be able to make a VALUES list to pass in a list you want to filter by with a readable value and an ID for joining, then LEFT JOIN with the other tables to pull in the data you are interested in.
if test ! $(which jq)
then
echo"Looks like you don't have jq installed. Installing jq..."
brew install jq
echo"...jq installed!"elseecho"You've already installed jq. Cool!"
fiCode language:PHP(php)
For loop
for site in 120285912028621201051120766312285671213504122472812295671239206doecho"iteration for $site"
doneCode language:PHP(php)
When using a $variable, you have to use “, not ‘ !
Variable assignment from the results of another command: name=$(command)
Array assignment from the results of another command: `array_name=($(command))
Use | @sh for transforming arrays into space separated strings
Convert JSON to CSV
# Select all children of the data object and extract the value of the id keys
| jq '.data[].id'# Select the first element of the data object and return the value of the filesystemBackupId key, raw/no quotes
| jq -r '.data[0].filesystemBackupId'# Convert a JSON file to CSV
(echo'username,profile_url,employer'; jq -r '.[] | [.username, .profile_url, .employer] | @csv' employers_5_1.json) > employers_5_1.csvCode language:PHP(php)
Set the maximum number of subdirectories that Wget will recurse into to depth. In order to prevent one from accidentally downloading very large websites when using recursion this is limited to a depth of 5 by default, i.e., it will traverse at most 5 directories deep starting from the provided URL. Set ‘-l 0’ or ‘-l inf’ for infinite recursion depth.