benhoyt / goawk

A POSIX-compliant AWK interpreter written in Go, with CSV support
https://benhoyt.com/writings/goawk/
MIT License
1.95k stars 84 forks source link

FIELDWIDTHS no effective #244

Closed happydentist closed 1 month ago

happydentist commented 1 month ago

gawk $1=$1" OFS=, FIELDWIDTHS="10 2 6 1" can split fixedwidth text file to csv format But goawk cannot,it just recognize space character for field seprator

benhoyt commented 1 month ago

Sorry, FIELDWIDTHS is a Gawk-specific feature that I have no plans to implement in GoAWK. For POSIX AWK, you can use substr manually to split such fields.