add another yq example
This commit is contained in:
		
							
								
								
									
										17
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										17
									
								
								README.md
									
									
									
									
									
								
							@@ -98,7 +98,7 @@ Tips
 | 
			
		||||
 | 
			
		||||
Needs [yq](https://github.com/mikefarah/yq) and [xsv](https://github.com/burntsushi/xsv) installed
 | 
			
		||||
 | 
			
		||||
    yq --from-file /dev/fd/7 ./db.json -o csv 7<<'EOM' | xsv table
 | 
			
		||||
    yq --from-file /dev/fd/7 db.json -o csv 7<<'EOM' | xsv table
 | 
			
		||||
    .items
 | 
			
		||||
    | del(.[] | .url)
 | 
			
		||||
    | (
 | 
			
		||||
@@ -109,3 +109,18 @@ Needs [yq](https://github.com/mikefarah/yq) and [xsv](https://github.com/burntsu
 | 
			
		||||
        ]
 | 
			
		||||
      )
 | 
			
		||||
    EOM
 | 
			
		||||
 | 
			
		||||
    yq --from-file /dev/fd/7 db.json -o csv 7<<'EOM' | head | xsv table
 | 
			
		||||
    .items
 | 
			
		||||
    | with(.[]; 
 | 
			
		||||
        del(.url),
 | 
			
		||||
        .title |= sub("\n", ""),
 | 
			
		||||
        .status |= sub("Done", "✓"),
 | 
			
		||||
        .status |= sub("Error", "✗"),
 | 
			
		||||
        .file_name |= sub("^$", "MISSING")
 | 
			
		||||
      )
 | 
			
		||||
    | (
 | 
			
		||||
        [ .[0] | keys ]
 | 
			
		||||
        + [ .[] | [.*] ]
 | 
			
		||||
      )
 | 
			
		||||
    EOM
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user