Hi Everyone,
Can someone plesae advise on converting the inputted file into required output? First field is L then amount will - symbol.
Sample input file
B|T|SASOFTB00016|20090330|20090330|15000|9089001
B|T|SABH00000012|20090330|20090330|7000|9089003
L|T|SABIOTN00029|20090330|20090330|250000|9089004
L|T|SABRE0000012|20090330|20090330|3000|9089005
B|T|SACRSNT00011|20090330|20090330|13000|9089006
Below is Output file and it have some hardcoded stuff at begining and in between.
851~123456~20090330~20090330~FI~15000~9089001~SASOFTB00016
851~123456~20090330~20090330~FI~7000~9089003~SABH00000012
851~123456~20090330~20090330~FI~-250000~9089004~SABIOTN00029
851~123456~20090330~20090330~FI~-3000~9089005~SABRE0000012
851~123456~20090330~20090330~FI~13000~9089006~SACRSNT00011
I have tried converting the file with awk but got below error.
awk -F "|" 'BEGIN {OFS="~"} {print $1 $2} ' inputfile
awk: syntax error near line 1
awk: bailing out near line 1
Can someone please advise?
Cheers,
gehlnar