![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| splitting words from a string | suresh_kb211 | Shell Programming and Scripting | 2 | 09-14-2009 06:16 AM |
| Grap data/string from lines between words | andrisetia | UNIX for Dummies Questions & Answers | 2 | 08-05-2008 07:48 AM |
| FInd the String between Two words | koti_rama | Shell Programming and Scripting | 6 | 08-05-2008 04:10 AM |
| creating a delimiter string | satish@123 | Shell Programming and Scripting | 0 | 05-21-2008 06:38 AM |
| To split a string to obtain the words delimited by whitespaces | Sudhakar333 | Shell Programming and Scripting | 4 | 08-06-2007 03:26 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Creating String from words in a file
Hi i have a file called search.txt
Which contains text like Car Bus Cat Dog Now i have to create a string from the file which should look like Car,Bus,Cat,Dog ( appending , is essential part) String must be stored in some variable so i can pass it as argument to some other command. my attempt so far while read line do var1=$(awk '{print $NF}') var2=',' var3=$var1$var2 done cat var3 but no out put .... plz help Thnx in advance |
|
|||||
|
If you are new to awk, then I recommend some reading up:
The GNU Awk User's Guide + lots of playing around with that (and other) scripts. Everything about awk you seek is there in that one web page. tyler_durden |
![]() |
| Bookmarks |
| Tags |
| shell scripting |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|