Computing.Net > Forums > Unix > Using a different delimiter as separator

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Using a different delimiter as separator

Reply to Message Icon

Name: poornimajayan
Date: May 6, 2009 at 07:05:57 Pacific
OS: KSH
Subcategory: Software Problems
Comment:

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



Sponsored Link
Ads by Google

Response Number 1
Name: lankrypt0
Date: May 6, 2009 at 11:04:04 Pacific
Reply:

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,'


0
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Using a different delimiter as separator

tweaking William's awk script www.computing.net/answers/unix/tweaking-williams-awk-script/5174.html

shell script/sed/awk www.computing.net/answers/unix/shell-scriptsedawk/5025.html

A different Version of Unix www.computing.net/answers/unix/a-different-version-of-unix/4210.html