Search Results

Search: Posts Made By: aahlrich
1,742
Posted By Scrutinizer
Hi, try: awk -F'[()]' '/^[^ \t]/{f=$2}...
Hi, try:
awk -F'[()]' '/^[^ \t]/{f=$2} {print>f}' file

--
Or if there are a lot more than 5 files:
awk -F'[()]' '/^[^ \t]/{close(f); f=$2} {print>>f}' file
4,783
Posted By Chubler_XL
It could be safer to multiply field 4 by 100...
It could be safer to multiply field 4 by 100 rather than removing decimal point. I thinking of input like 12.5:

awk -F, '{printf("%11s%s%010d%012d%s0\n",$1,$2,$3,$4*100,$5)}' checksab
4,783
Posted By neutronscott
Just literally add it to the printf format...
Just literally add it to the printf format specifier then.


awk -F, '{gsub(/\./,x,$4);printf("%11s%s%010d%012d%s0\n",$1,$2,$3,$4,$5)}' checksab
Showing results 1 to 3 of 3

 
All times are GMT -4. The time now is 02:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy