Sponsored Content
Top Forums Shell Programming and Scripting Need to extract data from Column having variable length column Post 302593994 by ns64110 on Monday 30th of January 2012 06:18:47 AM
Old 01-30-2012
Need to extract data from Column having variable length column

Hi ,

I need to extract data from below mentioned data, having no delimiter and havin no fixed column length.

For example:

Member nbr Ref no date
10000 1000 10202012
200000 2000 11202012

Output:

to update DB with memeber nbr on basis of ref no.

I tried to count the number of character between Member ..... Ref
but not able to get into result .. anyone can help on same
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Extract column data from File

I have a file containing the lines similar to the following entries: File1.txt: ..... -rw-r--r-- 1 root staff 4110 Aug 7 17:02 XXX_OrderNum1_date1_time1.txt -rw-r--r-- 1 root staff 4110 Aug 7 17:02 XXX_OrderNum2_date2_time1.txt -rw-r--r-- 1 root staff ... (3 Replies)
Discussion started by: sudheshnaiyer
3 Replies

2. Shell Programming and Scripting

Comparing column of variable length anf fixed width file

Hi, I have two input files. File1: ID Name Place 1-234~name1~Newyork 1-34~name2~Boston 1-2345~name3~Hungary File1 is a variable length file where each column is seperated by delimitter "~". File2: ID Country 1-34<<11 SPACES>>USA<<7 spaces>> 1-234<<10 SPACES>>UK<<8... (5 Replies)
Discussion started by: manneni prakash
5 Replies

3. Shell Programming and Scripting

how to extract a data from a column?

Hi All, Consider the below column, say this is the 4th column in a file PROV_STATS:::919900546978::Nokia 6600 PROV_STATS:::919900546978::Nokia 6600 PROV_STATS:::919900546978::Nokia 6600 I wanted to extract only 919900546978 from the 4 th cloumn using unix scripting? Kindly help (8 Replies)
Discussion started by: Balaji Sukumara
8 Replies

4. Shell Programming and Scripting

Extract data based on match against one column data from a long list data

My input file: data_5 Ali 422 2.00E-45 102/253 140/253 24 data_3 Abu 202 60.00E-45 12/23 140/23 28 data_1 Ahmad 256 7.00E-45 120/235 140/235 22 data_4 Aman 365 8.00E-45 15/65 140/65 20 data_10 Jones 869 9.00E-45 65/253 140/253 18... (12 Replies)
Discussion started by: patrick87
12 Replies

5. UNIX for Dummies Questions & Answers

Extract alphahumeric data from a column

Hi Unix Gurus, I am newbie to UNIX. I have a file test.txt with the follwing data aa90558 bb72962 cc08342 xy112233 yz25341 aa372099 cc34590231 bb880011 testfil Whatisit00 1234556 testfile2test I want to output only the items with two alpha followed by 5 numeric (ex aa90558 or... (2 Replies)
Discussion started by: SalM
2 Replies

6. Shell Programming and Scripting

for each different entry in column 1 extract maximum values from column 2 in unix/awk

Hello, I have 2 columns (1st column has multiple entries but the corresponding values in the column 2 may be the same or different.) however I want to extract unique values for each entry in column 1 by assigning the max value from column 2 SDF4 -0.211654 SDF4 0.978068 ... (1 Reply)
Discussion started by: Diya123
1 Replies

7. Shell Programming and Scripting

Compare 2 files and match column data and align data from 3 column

Hello experts, Please help me in achieving this in an easier way possible. I have 2 csv files with following data: File1 08/23/2012 12:35:47,JOB_5330 08/23/2012 12:35:47,JOB_5330 08/23/2012 12:36:09,JOB_5340 08/23/2012 12:36:14,JOB_5340 08/23/2012 12:36:22,JOB_5350 08/23/2012... (5 Replies)
Discussion started by: asnandhakumar
5 Replies

8. UNIX for Dummies Questions & Answers

Extract column data

I have a file which extracts data from an HTML file For Eg HTML file contains: New York;ABC;145;Yes;YES;No New York;BCD;113;Yes;YES;No New York;NAS;63;Yes;YES;No ------------------------ London-48;CBT;16;Yes;YES;No London-48;CME;17;Yes;YES;No London-48;EUR;52;Yes;YES;No... (3 Replies)
Discussion started by: newkid.7955
3 Replies

9. Shell Programming and Scripting

awk to extract value from column using variable

I am having trouble extracting the value in the columns declared in a variable. I have tried several different variation of awk but both give me the column number and not the actual value of that column. Any suggestions? Neither of the "extract" variables below are performing as desired ... (5 Replies)
Discussion started by: ncwxpanther
5 Replies

10. Shell Programming and Scripting

Get extract and replace column with link in a column where it exists

hi i have sample data a,b,c,d,e,g h http://mysite.xyx z,b,d,f,e,s t http://123124# a,b,c,i,m,nothing d,i,j,e,w,nothing output expected is a,b,c,d,e,http://mysite.xyx z,b,d,f,e,http://123124# a,b,c,i,m,nothing d,i,j,e,w,nothing i can get only links using grep -o 'http.*' i... (8 Replies)
Discussion started by: zozoo
8 Replies
Tangram::Type::Ref::FromMany(3pm)			User Contributed Perl Documentation			 Tangram::Type::Ref::FromMany(3pm)

NAME
Tangram::Type::Ref::FromMany - map references to persistent objects SYNOPSIS
use Tangram; # or use Tangram::Core; use Tangram::Type::Ref::FromMany; $schema = Tangram::Schema->new( classes => { Company => { fields => { ref => [ qw( ceo vice_ceo ) ] # or $schema = Tangram::Schema->new( classes => { Company => { fields => { ref => { ceo => { col => 'ceo', null => 0 }, vice_ceo => { ... } DESCRIPTION
This class is responsible for mapping fields that contain a reference to a Perl object. The persistent fields are grouped in a hash under the "ref" key in the field hash. The target object must belong to a persistent class. Tangram uses a column on the source object to store the id of the target object. The persistent fields may be specified either as a hash or as an array of field names. In the hash form, each entry consists in a field name and an associated option hash. The option hash may contain the following fields: * aggreg * col * type_col * class * null * deep_update Optional field "aggreg" specifies that the referenced element (if any) must be removed (erased) from persistent storage along with the source object. The default is not to aggregate. "col" sets the name of the column that contains the target object's id. This field is optional, it default to the persistent field name. You need to specify a column name if the field name is not an allowed SQL column identifier. "type_col" sets the name of the second column, that contains the target object's type id. This field is optional, it default to the value of "col" with ""_type"" appended. Set to the empty string ("") to disable this column, which requires that you also specify a class. "class" specifies the base class of the reference, which automatically disables "type_col" (currently unimplemented). "null", if present and set to true, directs deploy() to generate SQL code that allows NULL values for that column. Optional field "deep_update" specificies that the target object has to be updated automatically when "update" is called on the source object. Automatic update ensures consisitency between the Perl representation and the DBMS state, but degrades update performance so use it with caution. The default is not to do automatic updates. warning: there is currently something of a bug with all deep_update collections. If you (for instance) insert an object, and a property of that object that is deep_update, then sometimes things end up getting inserted twice - especially in mapping tables. This is currently under investigation. You may also pass the names of the persistent fields in an array, in which case Tangram uses the field names as column names and allows NULL values. IMPLEMENTATION NOTES
INHERITANCE Ref directly inherits from Tangram::Type::Scalar, and indirectly from Type. STORING REFERENCES When Tangram stores a reference to another object, it stores the target object's OID in the source object's table, just like what happens with other scalar types like String and Number. At least that's what basically happens, but there can be complications. Complication #1: the target object is not persistent yet. Thus it doesn't have an OID yet. Tangram will attempt to store the target object; if this succeeds, the target object gets an OID too and Tangram can proceed. Complication #2: Tangram may detect that the target object is already being saved; this happens in presence of cycles. Let's take an exam- ple: $homer = Person->new(); $marge = Person->new(); $homer->{partner} = $marge; $marge->{partner} = $homer; $storage->insert( $homer ); What happens here? Tangram detects that $homer refers to $marge, and that $marge is not yet persistent. So it ignores $homer for a while, and proceeds to storing $marge. In the process, Tangram sees that $marge refers to $homer - which is not persistent yet! its insert() is suspended. Fortunately Tangram realizes that, and doesn't attempt to store $homer again. Instead it stores a NULL in the 'partner' column of Marge's row. Tangram also schedules an UPDATE statement that will be executed just before returning from the call to insert(). That statement will patch Marge's 'partner' column with the proper OID. LOADING REFERENCES Tangram never loads the target object in the process of retrieving the source object. Doing so could have disastrous consequences. For example, consider a family tree, where each Person has a reference to Mom and Dad. Pulling any single Person would eventually retrieve everybody up to Adam and Eve! If Tangram did work that way, that is... Instead, Tangram ties all the fields that are declared as outgoing references to a package (Tangram::Lazy::Ref). The underlying object keeps track of the source object's OID, the Storage object, and the name of the persistent field. When - if - a reference field is accessed, the target object is pulled from the database (if it's not already present in memory), and the field is untied and its value is replaced with a reference to the target object. As a result, the target object is loaded on demand, but in an almost transparent fashion (why almost? because you can always use tied() on the field and detect that strange things are taking place). perl v5.8.8 2006-03-29 Tangram::Type::Ref::FromMany(3pm)
All times are GMT -4. The time now is 07:34 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy