The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
What the command to find out the record length of a fixed length file? tranq01 UNIX for Dummies Questions & Answers 9 12-04-2008 04:04 PM
grep exclude/find single and double quotes Lindy_so UNIX for Dummies Questions & Answers 4 03-06-2008 09:01 AM
read string, check string length and cut ozzy80 Shell Programming and Scripting 9 03-21-2007 05:56 PM
problem with single quotes in a string and findbug bob122480 Shell Programming and Scripting 9 01-19-2007 11:38 AM
sed problem - replacement string should be same length as matching string. amangeles Shell Programming and Scripting 4 01-11-2006 06:11 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-08-2008
jayakumarrt jayakumarrt is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 6
Awk:Find length of string omitting quotes

Hi ,

I have a file named "sample" having the data as follows.

"663005487","USD",0,1,"NR"

If i give like

a=`awk -F ',' '{printf length($2)}' sample`

(Trying to find length of second field)I should get the output for the above as 3 (Omitting double quotes) not 5.

How to do this..

Can anybody help me.

Thanks,
Jayakumar
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:26 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0