![]() |
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 |
| facing problem in starting a process in background using shell script. | dtomar | Shell Programming and Scripting | 8 | 04-17-2008 09:11 AM |
| Facing an issue related to cronjob | parindam | HP-UX | 1 | 09-13-2006 05:11 PM |
| please help as i am facing problem with uptime | guy009 | SUN Solaris | 3 | 06-02-2005 07:59 PM |
| facing problem with cut command | vivekshankar | UNIX for Dummies Questions & Answers | 3 | 05-25-2005 01:21 PM |
| facing a problem in redirection | vivekshankar | UNIX for Dummies Questions & Answers | 4 | 05-23-2005 01:24 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi All,
I have a got a problem .. I have t files as below: 1.txt contains Code:
----- ----- ----- column 1, "cat", column 24, "dog", column 100, "rat", ----- ----- ----- Code:
-----
-----
-----
awk 'BEGIN { printf ("%1s","cat")}'
awk 'BEGIN { printf ("%24s","dog")}'
-----
-----
-----
I have tried the following codes; awk '/column/ { print <> }' format.txt > we where the <> is awk 'BEGIN ..... The problem with this command is I cannot get the lines above or below the search. i.e only the lines containng "column" will be replaced and written to 2.sh If i use sed, I cannot get the fileds from the file 1.txt i.e; In order to get the "%1s" "%100s" from file 1.txt is not possible. Is their any way we can overcome these two problems ? thanks in advance JS Last edited by Yogesh Sawant; 04-09-2008 at 09:44 AM.. Reason: added code tags |
| Bookmarks |
| Tags |
| grep or |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|