![]() |
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 |
| 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 |
| Parsing String, Search then display rows | buddyme | UNIX for Advanced & Expert Users | 9 | 04-27-2008 04:43 AM |
| How to append a Value to all the rows in a file | dsshishya | Shell Programming and Scripting | 2 | 03-20-2008 05:04 PM |
| append a string to a grep result | melanie_pfefer | Shell Programming and Scripting | 8 | 03-19-2008 07:19 AM |
| Need to append file name to all rows in in .csv file | Satyagiri | Shell Programming and Scripting | 3 | 10-13-2006 02:32 AM |
| append esc string | beilstwh | Shell Programming and Scripting | 2 | 05-11-2005 01:33 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Append string in all rows
I would like to append a string at the end of each row of a .dat file.
please give me some advice? Thanks. e.g. #content in abc.dat aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ... #after running the script/command, "bbbbbbbbbb" will be appended as follow. aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbb aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbb ... |
|
||||
|
I have writen a simple script to arhieve my purpose. However, "There is not enough memory available now" is prompted. Can my script be optimized to reduce resource? Thanks.
append_string=`cat ${source_file} | awk ' BEGIN { FS = "\n" } { if ($1 ~ "SWIFT5" ) {print $1, " :: SEND = N :: SEV = 0 :: ERROR = 11414 :: COMP = Name :: " } else {print $1;} }'` |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|