What do you want to save?
Add Code snippet
New code examples
-
Shell/Bash 2021-09-18 00:08:02
awk '(split by space)
Just use function split in awk command to split a line into an array 'a' using a choosen string as delimiter as for example ", " in next use case: echo "hi, bye, hey" | awk '{split($0,a,", "); print a[3],a[2],a[1]}' Add solution -
Shell/Bash 2021-09-13 17:23:02
jq for html
Install pup command for structuring in html format outputs into lines: brew install pup Then you can use pup command to split, parse or wrap html outputs: cat file.html | pup #html is parsed into an optimally visible format cat file.html | pup 'span#See_a... Add solution -
Html 2021-09-09 01:20:02
yaml multiline string
# Use > most of the time: interior line breaks are stripped out, although you get one at the end: key: > Your long string here. # Use | if you want those linebreaks to be preserved as \n (for instance, embedded markdown with paragraphs). key... Add solution -
Shell/Bash 2021-09-06 08:31:02
Using ffmpeg to split video files by size
#!/bin/bash # Short script to split videos by filesize using ffmpeg by LukeLR if [ $# -ne 3 ]; then echo 'Illegal number of parameters. Needs 3 parameters:' echo 'Usage:' echo './split-video.sh FILE SIZELIMIT "FFMPEG_ARGS' echo ... Add solution -
Python 2021-08-29 19:54:02
how to convert a string to a list python
# To split the string at every character use the list() function word = 'abc' L = list(word) L # Output: # ['a', 'b', 'c'] # To split the string at a specific character use the split() function word = 'a,b,c' L = word.split(',') L # Output: # ['a', 'b', ... Add solution -
Python 2021-08-29 10:35:02
colon in python function
#It's a function annotation; function arguments and the return value can be tagged with arbitrary Python expressions. Python itself ignores the annotation (other than saving it), but third-party tools can make use of them. #In this case, it is intended a... Add solution -
Shell/Bash 2021-08-27 19:47:03
bash split string with awk
# Basic syntax: awk '{split($column_to_split,array_name,"delimiter"); print a[index]}' # Where: # - the array_name is usually shortened to a # - delimiter is the delimiter you want to split the string by # - index is the index of the string &quo... Add solution
Best helpers
+10
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5
+5