Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi,
I was trying to use a delimiter ( | ) to get the file name and the count and it works.wc -l *.txt | awk '{print $2,"|",$1}' > bb.txt
I would like to know whether I can keep the delimiter in any other type apart from using double quotes. ("|").I tried using single quotes('|').But it does not work

the reason you cannot use single quotes is because you start with one before the {print. If you used a single quote, you would be ending the statement between the single quotes prematurely. your statement would only read:
awk '{print $2,'

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