need to convert a decimal value to an ascii char with awk for the field delimiter

Hello,

I need an awk script to receive a variable that's an decimal value such as 009 or 031 and then convert this value to an ascii character to use as the FS (field separator for the input file).

For example,

009 should be converted to an ascii tab
031 should be converted to an ascii Unit Separator

awk -v delimiter="031" '
BEGIN {
FS=delimiter;

\} \# end BEGIN
   \{
            
    \}
    END\{
           
    \}' <infile >outfile

use awk to get the value to use for awk :slight_smile:

delim=`echo "009" | awk '{printf("%c", $0);}'`


awk -F "${delim}" ...etc...