Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi Gurus,
i had a Table with the columns
col1 Decimal(3),
col2 Decimal(2),
col3 String(1),
col4_blank1 String(2),
col5_blank2 String(10),
col6 String(3);
the Data(Records) of the Table in flat file is89522D 085NOVOLIN BRAND 888888ALL OTHER
i want to display the output by separating the columns with ~ based on the column size is 3 of col1 Decimal(3) and col2 having the size 2...
895~22~D ~ ~085~NOVOLIN~
Thanks in Advance

echo xxx | awk '{ print substr($1,1,3) "~" substr($2,1,2) "~" $3 }'
AWK by defaults treats all inputs as text

![]() |
![]() |
![]() |
| Login or Register to Reply | |
| Login | Register |
| Ads by Google |