Hi All,
I have several lines in a text flie like this:
#line 1 aaa aaaaaa # AAAA
#line 2 6% BBB # AAAA
line 3 bbbbbbbbbbb bbbb
#line 4 cccc CCCCC
line 5 bbbbbbb bbbb
The aout file wil be:
#line 1 aaa aaaaaa # AAAA
#line 2 6% BBB # AAAA line 3 bbbbbbbbbbb bbbb
#line 4 cccc CCCCC line 5 bbbbbbb bbbb
I am using this awk for joining lines if first character is not a #:
awk '
NR==1 {printf $0;next}
/^#/{printf "\n"$0;next}{printf " "$0}' in>out
This command stops at line 2 because of %, and this message appears:
awk: There is not enough arguments in printf( BBB # AAAA
register number 2.
Any help offered is truly appreciated.
thanks
I have several lines in a text flie like this:
#line 1 aaa aaaaaa # AAAA
#line 2 6% BBB # AAAA
line 3 bbbbbbbbbbb bbbb
#line 4 cccc CCCCC
line 5 bbbbbbb bbbb
The aout file wil be:
#line 1 aaa aaaaaa # AAAA
#line 2 6% BBB # AAAA line 3 bbbbbbbbbbb bbbb
#line 4 cccc CCCCC line 5 bbbbbbb bbbb
I am using this awk for joining lines if first character is not a #:
awk '
NR==1 {printf $0;next}
/^#/{printf "\n"$0;next}{printf " "$0}' in>out
This command stops at line 2 because of %, and this message appears:
awk: There is not enough arguments in printf( BBB # AAAA
register number 2.
Any help offered is truly appreciated.
thanks