04-01-2009
to break a file into 2 files after matching a pattern.
Hi,
i need to break a file into 2 files afetr matching a pattern
for ex. there is a fil, file .txt which contains
Quote:
brett & vivs RM03PE00481630390046 0018H00000421973G D6C
BC7116379A00607-1 3000023237098964413 00000000A000000001199100000116310000000036{D ALPHA beta CS D7C
Mat & Demon RM03PE00481630390046 0018H00000421973G D6C
BA8007-1 300002323963164 000000000B000000001199000116310000000072{D ALPHA beta D7C
BC71160607-1 3000024456898962294 000000000A000000007612500073841000000000000228DD ALPHA beta CS D7C
john & tom RM03PE00481630390046 0018H00000421973G D6C
BA8007-1 300002323963164 000000000B000000001199000116310000000072{D ALPHA beta D7C
here i need to look for mat $ demon if it matches then i need to transfer the data into another file till the line in which a "d6s" comes,and i have to delete tat line from the file and copy the remaining data in another file
like
file 1
Quote:
Mat & Demon RM03PE00481630390046 0018H00000421973G D6C
BA8007-1 300002323963164 000000000B000000001199000116310000000072{D ALPHA beta D7C
BC71160607-1 3000024456898962294 000000000A000000007612500073841000000000000228DD ALPHA beta CS D7C
and file 2
Quote:
brett & vivs RM03PE00481630390046 0018H00000421973G D6C
BC7116379A00607-1 3000023237098964413 00000000A000000001199100000116310000000036{D ALPHA beta CS
john & tom RM03PE00481630390046 0018H00000421973G D6C
BA8007-1 300002323963164 000000000B000000001199000116310000000072{D ALPHA beta D7C
thanks in advance
Last edited by manit; 04-01-2009 at 07:28 AM..
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I am trying to delete a load of core files, but make sure I only delete core files. The system I am using has many files with core in the name, so I obviously can not simply search for "core".
I have tried using the 'find' command with pattern matching via , and know that his is the way... (3 Replies)
Discussion started by: littleIdiot
3 Replies
2. UNIX for Dummies Questions & Answers
Hi,
I am writing a BASH shell script. I would like to count all the files in the CURRENT directory matching a specific pattern. Could someone suggest the best/simplest way to do this. I have thought of these solutions (for simplicity the pattern is all files starting with A):
ls -1 *A | wc -l... (5 Replies)
Discussion started by: msb65
5 Replies
3. UNIX for Dummies Questions & Answers
Hi,
I have following files in my directory:
/TESTDONTDEL> ls -alt
total 14
drwxr-xr-x 2 oracle dba 1024 May 15 06:30 .
-rw-r--r-- 1 oracle dba 40 May 15 06:30 exception.txt
-rw-r--r-- 1 oracle dba 19 May 15 06:22 ful_1234_test1.txt
-rw-r--r-- 1... (2 Replies)
Discussion started by: sagarparadkar
2 Replies
4. Shell Programming and Scripting
How can i break a text file into parts that occur between a specific pattern?
I have text file having various xml many tags like which starts with the tag "<?xml version="1.0" encoding="utf-8"?>" . I have to break the whole file into several xmls by looking for the above pattern.
All the... (9 Replies)
Discussion started by: abhinav192
9 Replies
5. Shell Programming and Scripting
Hi all,
I have to check whether certain files exist using a if statement. I have to check this by matching a pattern of filename: e.g.
if ]
This statement should be "true" if any files like test.dat11, test.dat22 etc are present in the source dir. However, this statement is checking only... (2 Replies)
Discussion started by: sweety123
2 Replies
6. Shell Programming and Scripting
Hi All,
I am stuck for quite sometime now. Below is a line in my file -
GS|ED|001075|001081|20110626|1806|100803|X|004010ST|130|100803001
This line occurs only once and it is the second line.
I have to break this line into two lines from ST (bold) such that it looks like -... (5 Replies)
Discussion started by: ihussain
5 Replies
7. Shell Programming and Scripting
I am on ubuntu 11.10 using bash scripts
I want to remove all files matching a string pattern and I am using the following code
find . -name "*$pattern*" -exec rm -f {} \;I have encountered a problem when $pattern is empty. In this case all my files in my current directory were deleted. This... (3 Replies)
Discussion started by: kristinu
3 Replies
8. Shell Programming and Scripting
I have one single shown below and I need to break each ST|850 & SE to separate file using unix script. Below example should create 3 files. We can use ST & SE to filter as these field names will remain same.
Please advice with the unix code.
ST|850
BEG|PO|1234
LIN|1|23
SE|4
ST|850... (3 Replies)
Discussion started by: prasadm
3 Replies
9. Shell Programming and Scripting
Hi Techies,
I need a help in finding junk characters and remove them from a Datafile.
we have a file and it had crores of records like below
SGSN_MCC_MNC=01150
but sometime due to the issue with sending server we are getting some junk characters in the middle of data like below
... (6 Replies)
Discussion started by: mahi_mayu069
6 Replies
10. Shell Programming and Scripting
Hi
I need to do a patten match between files .
I am new to shell scripting and have come up with this so far. It take 50 seconds to process files of 2mb size . I need to tune this code as file size will be around 50mb and need to save time.
Main issue is that I need to search the pattern from... (2 Replies)
Discussion started by: nitin_daharwal
2 Replies
LEARN ABOUT DEBIAN
slarfgp.f
slarfgp.f(3) LAPACK slarfgp.f(3)
NAME
slarfgp.f -
SYNOPSIS
Functions/Subroutines
subroutine slarfgp (N, ALPHA, X, INCX, TAU)
SLARFGP
Function/Subroutine Documentation
subroutine slarfgp (integerN, realALPHA, real, dimension( * )X, integerINCX, realTAU)
SLARFGP
Purpose:
SLARFGP generates a real elementary reflector H of order n, such
that
H * ( alpha ) = ( beta ), H**T * H = I.
( x ) ( 0 )
where alpha and beta are scalars, beta is non-negative, and x is
an (n-1)-element real vector. H is represented in the form
H = I - tau * ( 1 ) * ( 1 v**T ) ,
( v )
where tau is a real scalar and v is a real (n-1)-element
vector.
If the elements of x are all zero, then tau = 0 and H is taken to be
the unit matrix.
Parameters:
N
N is INTEGER
The order of the elementary reflector.
ALPHA
ALPHA is REAL
On entry, the value alpha.
On exit, it is overwritten with the value beta.
X
X is REAL array, dimension
(1+(N-2)*abs(INCX))
On entry, the vector x.
On exit, it is overwritten with the vector v.
INCX
INCX is INTEGER
The increment between elements of X. INCX > 0.
TAU
TAU is REAL
The value tau.
Author:
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date:
November 2011
Definition at line 105 of file slarfgp.f.
Author
Generated automatically by Doxygen for LAPACK from the source code.
Version 3.4.1 Sun May 26 2013 slarfgp.f(3)