![]() |
|
|
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. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
help on awk
Hi,
i have many lines (each line will have a number) in a text file as below: 111 222 333 and i need to format it as below '111', '222', '333'); Please note that there is no comma (,) after last entry but closed with ); I guess it can be done using awk but could not succeed. Please advise. TIA Prvn |
|
||||
|
Quote:
The Useless Use Of cat, wc, awk, head, tail Award ![]() Only sed and the job is done: Code:
sed -e "s/.*/'&',/" -e '$ s/.$/);/' data.file |
|
||||
|
i'm still learning too, thx for the tip, don't need to be rude though.
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|