seaswalker / posts

0 stars 0 forks source link

AWK #61

Open seaswalker opened 2 years ago

seaswalker commented 2 years ago

抽取文件中特定规则字符串:

awk 'match($0, /orderNo=([0-9]+),/, a) {print \",\\\"\"a[1]\"\\\"\"}' .\orders.txt

原始内容格式比如:

name="skywalker",orderNo="73239123",city="上海"