Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Mapping a data in a file and delete line in source file if data does not exist. Post 302688941 by kokoro on Monday 20th of August 2012 01:43:16 PM
Old 08-20-2012
Yes exactly my friend, i hope someone can help me in composing a one or two liner awk command since I am a bit worried with the time it would take to process the source file if it has hundred thousands of records in it.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Compare data in 2 files and delete if file exist

Hi there, I have written a script called "compare" (see below) to make comparison between 2 files namely test_put.log and Output_A0.log #!/bin/ksh while read file do found="no" while read line do echo $line | grep $file > /dev/null if then echo $file found found="yes" break fi... (3 Replies)
Discussion started by: lweegp
3 Replies

2. Shell Programming and Scripting

how to delete record in file data with index in another file?

I want to deal with several data, i.e., data.*.txt with following structure MSG|20010102|123 125 4562 409|SEND MSG|20010102|120 230|SEND MSG|20010102|120 204 5071|SEND MSG|20010103|2 11 1098 9810|SEND ...... index file index.txt is 11 201 298 100 ...... What I want to do is: 1)... (0 Replies)
Discussion started by: zhynxn
0 Replies

3. Shell Programming and Scripting

Post Shell programming: Question about source a file and read data from the file

This is shell programming assignment. It needs to create a file called .std_dbrc contains STD_DBROOT=${HOME}/class/2031/Assgn3/STD_DB (which includes all my simple database files) and I am gonna use this .std_dbrc in my script file (read the data from the database files) like this: .... (3 Replies)
Discussion started by: ccwq
3 Replies

4. Shell Programming and Scripting

Delete line in file based on data in another file

Hi there I would like to create a shell script to do the following: - delete a line in file1 if it contains the data string in file2 eg: file1 1 100109942004051510601703694 0.00 0.00 2 100109942004051510601702326 0.00 0.00 3 ... (1 Reply)
Discussion started by: earth_goddess
1 Replies

5. Shell Programming and Scripting

Delete lines line by match data 2 file.

i need to delete the lines is match from file data 1 & data 2 please help? data 1 4825307 4825308 4825248 4825309 4825310 4825311 4825336 data 2 4825248 0100362210 Time4Meal 39.00 41.73 MO & MT MT SMS 4825305 0100367565... (2 Replies)
Discussion started by: ooilinlove
2 Replies

6. Shell Programming and Scripting

Help in adding a data after a particular line of data in a file.

Hi.. I'm into a bump after trying to solve this prob.. i've a file with contents like below. <blankline> 'pgmId' : 'UNIX', 'pgmData' : 'textfile', 'author' : 'admin', ....... Now i'm trying to insert a new data after pgmId. so the final output will be... (7 Replies)
Discussion started by: arjun_arippa
7 Replies

7. Shell Programming and Scripting

Redirect output to a different text file depending source of data

I have a list of DNS servers I need to look up information on. Each of these servers has a master and a slave database. Essentially what I need to do is create two text files for each server. One with the Master view and one with the Slave view. There's 20 servers, in the end I should have 40 text... (4 Replies)
Discussion started by: spartan22
4 Replies

8. UNIX for Dummies Questions & Answers

using sed delete a line from csv file based on specific data in two separate fields

Hello, :wall: I have a 12 column csv file. I wish to delete the entire line if column 7 = hello and column 12 = goodbye. I have tried everything that I can find in all of my ref books. I know this does not work /^*,*,*,*,*,*,"hello",*,*,*,*,"goodbye"/d Any ideas? Thanks Please... (2 Replies)
Discussion started by: Chris Eagleson
2 Replies

9. UNIX for Dummies Questions & Answers

Formatting data in a raw file by using another mapping file

Hi All, i have a requirement where i need to format the input RAW file ( which is CSV) by using another mapping file(also CSV file). basically i am getting feed file with dynamic headers by using mapping file (in that target field is mapped with source filed) i have to convert the raw file into... (6 Replies)
Discussion started by: ravi4informatic
6 Replies

10. Shell Programming and Scripting

Compare the source definition file with data file

Hi How to compare the source definition file in unix with the data file . Please can you share me example if some one has done it before (3 Replies)
Discussion started by: Raj4fusion
3 Replies
tensor(2rheolef)						    rheolef-6.1 						  tensor(2rheolef)

NAME
tensor - a N*N tensor, N=1,2,3 SYNOPSYS
The tensor class defines a 3*3 tensor, as the value of a tensorial valued field. Basic algebra with scalars, vectors of R^3 (i.e. the point class) and tensor objects are supported. IMPLEMENTATION
template<class T> class tensor_basic { public: typedef size_t size_type; typedef T element_type; // allocators: tensor_basic (const T& init_val = 0); tensor_basic (T x[3][3]); tensor_basic (const tensor_basic<T>& a); // affectation: tensor_basic<T>& operator = (const tensor_basic<T>& a); tensor_basic<T>& operator = (const T& val); // modifiers: void fill (const T& init_val); void reset (); void set_row (const point_basic<T>& r, size_t i, size_t d = 3); void set_column (const point_basic<T>& c, size_t j, size_t d = 3); // accessors: T& operator()(size_type i, size_type j); T operator()(size_type i, size_type j) const; point_basic<T> row(size_type i) const; point_basic<T> col(size_type i) const; size_t nrow() const; // = 3, for template matrix compatibility size_t ncol() const; // inputs/outputs: std::ostream& put (std::ostream& s, size_type d = 3) const; std::istream& get (std::istream&); // algebra: bool operator== (const tensor_basic<T>&) const; bool operator!= (const tensor_basic<T>& b) const { return ! operator== (b); } template <class U> friend tensor_basic<U> operator- (const tensor_basic<U>&); template <class U> friend tensor_basic<U> operator+ (const tensor_basic<U>&, const tensor_basic<U>&); template <class U> friend tensor_basic<U> operator- (const tensor_basic<U>&, const tensor_basic<U>&); template <class U> friend tensor_basic<U> operator* (int k, const tensor_basic<U>& a); template <class U> friend tensor_basic<U> operator* (const U& k, const tensor_basic<U>& a); template <class U> friend tensor_basic<U> operator* (const tensor_basic<U>& a, int k); template <class U> friend tensor_basic<U> operator* (const tensor_basic<U>& a, const U& k); template <class U> friend tensor_basic<U> operator/ (const tensor_basic<U>& a, int k); template <class U> friend tensor_basic<U> operator/ (const tensor_basic<U>& a, const U& k); template <class U> friend point_basic<U> operator* (const tensor_basic<U>&, const point_basic<U>&); template <class U> friend point_basic<U> operator* (const point_basic<U>& yt, const tensor_basic<U>& a); point_basic<T> trans_mult (const point_basic<T>& x) const; template <class U> friend tensor_basic<U> trans (const tensor_basic<U>& a, size_t d = 3); template <class U> friend tensor_basic<U> operator* (const tensor_basic<U>& a, const tensor_basic<U>& b); template <class U> friend void prod (const tensor_basic<U>& a, const tensor_basic<U>& b, tensor_basic<U>& result, size_t di=3, size_t dj=3, size_t dk=3); template <class U> friend tensor_basic<U> inv (const tensor_basic<U>& a, size_t d = 3); template <class U> friend tensor_basic<U> diag (const point_basic<U>& d); template <class U> friend tensor_basic<U> identity (size_t d=3); template <class U> friend tensor_basic<U> dyadic (const point_basic<U>& u, const point_basic<U>& v, size_t d=3); // metric and geometric transformations: template <class U> friend U dotdot (const tensor_basic<U>&, const tensor_basic<U>&); template <class U> friend U norm2 (const tensor_basic<U>& a) { return dotdot(a,a); } template <class U> friend U dist2 (const tensor_basic<U>& a, const tensor_basic<U>& b) { return norm2(a-b); } template <class U> friend U norm (const tensor_basic<U>& a) { return ::sqrt(norm2(a)); } template <class U> friend U dist (const tensor_basic<U>& a, const tensor_basic<U>& b) { return norm(a-b); } T determinant (size_type d = 3) const; template <class U> friend U determinant (const tensor_basic<U>& A, size_t d = 3); template <class U> friend bool invert_3x3 (const tensor_basic<U>& A, tensor_basic<U>& result); // spectral: // eigenvalues & eigenvectors: // a = q*d*q^T // a may be symmetric // where q=(q1,q2,q3) are eigenvectors in rows (othonormal matrix) // and d=(d1,d2,d3) are eigenvalues, sorted in decreasing order d1 >= d2 >= d3 // return d point_basic<T> eig (tensor_basic<T>& q, size_t dim = 3) const; point_basic<T> eig (size_t dim = 3) const; // singular value decomposition: // a = u*s*v^T // a can be unsymmetric // where u=(u1,u2,u3) are left pseudo-eigenvectors in rows (othonormal matrix) // v=(v1,v2,v3) are right pseudo-eigenvectors in rows (othonormal matrix) // and s=(s1,s2,s3) are eigenvalues, sorted in decreasing order s1 >= s2 >= s3 // return s point_basic<T> svd (tensor_basic<T>& u, tensor_basic<T>& v, size_t dim = 3) const; // data: T _x[3][3]; }; typedef tensor_basic<Float> tensor; // inputs/outputs: template<class T> inline std::istream& operator>> (std::istream& in, tensor_basic<T>& a) { return a.get (in); } template<class T> inline std::ostream& operator<< (std::ostream& out, const tensor_basic<T>& a) { return a.put (out); } // t = a otimes b template<class T> tensor_basic<T> otimes (const point_basic<T>& a, const point_basic<T>& b, size_t na = 3); // t += a otimes b template<class T> void cumul_otimes (tensor_basic<T>& t, const point_basic<T>& a, const point_basic<T>& b, size_t na = 3); template<class T> void cumul_otimes (tensor_basic<T>& t, const point_basic<T>& a, const point_basic<T>& b, size_t na, size_t nb); rheolef-6.1 rheolef-6.1 tensor(2rheolef)
All times are GMT -4. The time now is 11:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy