whats wrong with this awk???

while read LINE;
do
echo |awk -v LIN="${LINE}" '{print substr(LIN,1,7)","substr(LIN,8,5)" ,"substr(LIN,14,10)","substr(LIN,24,6)" ,"substr(LIN,30,8)}';
done < exp1.txt

exp1.txt = 1234 grgrg 203902 ksdjh oehr weo

why it doesn't work??

thanks.

Could you post the output ?

I get the right thing:

1234 gr,grg 2 ,3902 ksdjh, oehr ,weo

I did a mistake :frowning: :frowning:

thanks for your reply :slight_smile:

what removed is going on????????

while read LINE;
do
echo LINE |awk -v LIN="${LINE}" '{print substr(LIN,1,7)","substr(LIN,8,5)","substr(LIN,14,10)","substr(LIN,24,6)","substr(LIN,30,8)","substr(LIN,38,4)}';
done < prefinal.txt

prefinal.txt:
1234 grgrg 203902 ksdjh oehr weo

why it doesn't work????????

removed cygwin :smiley:

You broke the very first rule of the forum.

(1) No flames, shouting (all caps), sarcasm, bullying, profanity or arrogant posts.

Please adhere to the rules.

I am sorry,I didn't know about it...