#!/usr/bin/env runawk #use "tokenre.awk" # This demo splits input line into tokens according to regexp that # defines a token, not between tokens. # # Suported tokens: # - sequence of non-space and not " characters # - "la-la-la even spaces here " # Input files for this demo: examples/demo_tokenre.in* BEGIN { TRE="\"[^\"]*\"|[^\"[:space:]]+" } { print "NF=" NF for (i=1; i <= NF; ++i){ printf "$%d=%s\n", i, $i } }