Horje
awk field separator Code Example
awk use string as field separator
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]}'
Or you could also do next:
echo "a, b, c" | sed 's/, /,/g' file.txt | awk -F ',' '{print $1 $2 $3}'
awk field separator
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]}'




Shell

Related
20.04 Code Example 20.04 Code Example
terraform Code Example terraform Code Example
awk output field separator Code Example awk output field separator Code Example
awk field separator space Code Example awk field separator space Code Example
realtek 8852 Code Example realtek 8852 Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8