![]() |
|
|
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 |
| how to retreive a block of data from the file | aoussenko | Shell Programming and Scripting | 4 | 06-26-2008 12:03 PM |
| how to retreive a block of data from the file | aoussenko | Shell Programming and Scripting | 2 | 06-26-2008 08:18 AM |
| Deleting text block in file | andre123 | Shell Programming and Scripting | 1 | 02-27-2007 01:17 PM |
| Select last block from a file | misenkiser | Shell Programming and Scripting | 9 | 10-11-2006 10:32 AM |
| extract block in file | sskb | UNIX for Dummies Questions & Answers | 5 | 10-25-2001 11:29 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Adding a block to the file
Hi guys,
I am trying to add the content of fileB into fileA but after a specific block within FileA for instance i have a file that starts as follow: ------------------------------------------------------------------------------- -- Title : -- Project : ------------------------------------------------------------------------------- -- File : -- Author : -- Company : -- Created : -- Last update: 2458/05/14 -- Platform : ------------------------------------------------------------------------------- -- Description: <cursor> ------------------------------------------------------------------------------- -- Copyright (c) ------------------------------------------------------------------------------- -- Date Version Author Description -- 2098-10-17 1.0 Created -- 2076-12-11 1.0 Imported from -- 2747-05-03 -------------------------------------------------------------------------- ------------------------------------------------------------------------ -- -- Portions Copyright (c) -- All rights reserved -- -- Proprietary and Confidential -- -- Portions of this code embody materials and concepts which are confidential -- to and is made available -- solely pursuant to the terms of a written agreement with -- . -- -------------------------------------------------------------------------- ...the rest of the code I need to remove the bold part and add content of fileb under the tilted part. i am pretty much helpless on this part. I was wondering if someone could help me with this? Thanks, |
|
||||
|
Code:
head -n 22 fileA >newfile cat fileB >>newfile tail -n 13 fileA >>newfile mv newfile fileA This is a very simple solution if fileA is exactly has you posted. Since you didn't request any pattern matching I figured this is an isolated case. |
|
||||
|
the problem is that the tilted part could be longer and there are a lot of cases which i could not consider one by one.
secondly there are some code after the bold block and i don't know the exact number of line for each file and then i need to have the exact position where bold block starts(according to ur suggestion) i apologize for posting such a wage question but this is what i am dealing right now one more thing, bold block need to be removed. sorry if it is not clear in my previous post; but it seems like u misunderstood my question. anyhow, I appreciate your help |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|