The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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
Not able to insert data through crontab megh SUN Solaris 2 12-29-2008 08:36 AM
Not able to insert data megh SUN Solaris 1 12-05-2008 12:20 AM
unable Insert data from .dat file to .xls can anybody help me kreddy2003 Shell Programming and Scripting 1 05-28-2008 06:33 AM
help me to to insert data babu@shell UNIX for Dummies Questions & Answers 10 10-24-2006 03:25 AM
sed, insert data from a file to another? ctcuser Shell Programming and Scripting 4 05-03-2005 02:43 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 03-17-2009
aemunathan aemunathan is offline
Registered User
  
 

Join Date: May 2008
Posts: 75
How to insert data befor some field in a row of data depending up on values in row

Hi

I need to do some thing like "find and insert before that " in a file which contains many records. This will be clear with the following example.

The original data record should be some thing like this
Code:
60119827  RTMS_LOCATION_CDR    INSTANT_POSITION_QUERY    1236574686123083rtmssrv7      20090309102806279           441           442
           783           WEB       1568          GMLC919443259137    FAILURE6         1236574665595654lessrv1
but due to some system errors the file generated has got one missing information and it looks like

Code:
60119827  RTMS_LOCATION_CDR    INSTANT_POSITION_QUERY    1236574686123083rtmssrv7      20090309102806279                         442
           783           WEB       1568          GMLC919443259137    FAILURE6         1236574665595654lessrv1
both has got 248 charaters length. but in the second record one data is missing i.e 441

i need to insert 441 exactly in that position if 442 is available as next data.
its some thing like case statements...

i will be having different values instead of 442 and their corresponding previous position data

How to go about this...any one help me out...
Am having lot of error files like this to be treated, hence can i do anything like upload in a DB and insert data based on the values in the row at the position i told before (442)

Help me out!!!
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:38 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0