![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How can i remove spaces in between the fields in a file | dsravan | Shell Programming and Scripting | 3 | 09-26-2006 04:11 PM |
| Find null fields in file | rahulrathod | Shell Programming and Scripting | 2 | 06-23-2006 04:17 AM |
| Delete spaces in between fields | guiguy | Shell Programming and Scripting | 12 | 03-31-2006 09:38 AM |
| align several fields and fill spaces with zero | DebianJ | Shell Programming and Scripting | 2 | 11-23-2005 07:51 AM |
| Strip leading and trailing spaces only in a shell variable with embedded spaces | jerardfjay | Shell Programming and Scripting | 6 | 03-07-2005 02:24 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Find fields with no spaces in value
This is what I need to do
I have a file that has a field with values like this 1111 2222 3333 4444 55555 666 333333333 444444444 I need for my command to out put only those fields that do not have spaces in them. So my output for the above file would be 333333333 444444444 how do I go about this? |
|
||||
|
Thanks vgersh appreciate your help....I also came up with the following during one of my searches
"After the authors got over their initial consternation, they decided to accept the fact, and enhance Awk to make it a better general-purpose programming tool. The new version of Awk was released in 1985. Since the old Awk implementation is still the standard in UN*X systems, the new version is often, if not always, known as Nawk ("New Awk") to distinguish it from the old one." from http://www.vectorsite.net/tsawk3.html |
|
||||
|
ignore spaces in search pattern in grep
Hi
can you also tell me how i can acheive the below i have a code in which i assign a value to a str variable. Say line contains, line=Field|Location ES|comp|dur|10 str=`echo $line | awk '{split($0, date,"|"); print date[2]"|"date[3]"|"date[4] }'` i want to grep for str value in a file in the script. for j in `cat uniqfile | egrep "${str}"` but this is giving me the output as Field|location ES|comp|dur|10 Whereas i want the output as Field|Location ES|comp|dur|10 how can i suppress the space here? could you please help. Thanks, Mike |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|