Sponsored Content
Top Forums Shell Programming and Scripting Search a text, and Join the next line. Post 302543555 by spiabhi on Monday 1st of August 2011 08:54:20 AM
Old 08-01-2011
Thanks Yazu for your prompt reply,
but i am so sorry to say that i gave an error saying,
Code:
sed: Function /LM-UPFJOY *$/ {N; s/ *\n/ / } cannot be parsed.

Kindly help.

---------- Post updated at 06:24 PM ---------- Previous update was at 06:20 PM ----------

In case of Mirni's solution, it gave some weired results as following.

Code:
CR LM-UPFJOY en:102 Typ:1 Nro:71818037 Chk:1 Tim:2011-07-16/08:46:03 oiw:3 oTy:145 oAd:50206 diw:0 dTy:145 dAd:919399951328 SMC:919821900040
iTm:2011-07-16/08:46:03 dat:0 tcl:1 mLM-UPFJOY n:95 pid:0 srr:62 def:0 sde:LM-UPFJOY M-UPFJOY 
con:0-0-0 spe:0 dcs:0 ame:1 pri:4 vms:919821000001 ims:N/A                    
CR LM-UPFJOY en:102 Typ:1 Nro:71818038 Chk:1 Tim:2011-07-16/08:46:03 oiw:3 oTy:145 oAd:50206 diw:0 dTy:145 dAd:919848170499 SMC:919821900040
iTm:2011-07-16/08:46:03 dat:0 tcl:1 mLM-UPFJOY n:95 pid:0 srr:62 def:0 sde:LM-UPFJOY M-UPFJOY 
con:0-0-0 spe:0 dcs:0 ame:1 pri:4 vms:919821000001 ims:N/A

Which I guess had replaced the L in Len:102 by LM-UPFJOY.
Kindly Help.

Last edited by Franklin52; 08-01-2011 at 11:07 AM.. Reason: Please use code tags for data and code samples, thank you
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Search for text and print the next line

Hi, I want to write a small script to search for a text in file and when its found I want to print the next line. I try to write that script but I could not manage it, I just write the following script the find the exact line but I want the next line. $ sed -n -e '/Form not/p' test.txt... (2 Replies)
Discussion started by: alijassim
2 Replies

2. Shell Programming and Scripting

Search and replace multi-line text in files

Hello I need to search for a mult-line text in a file exfile1 and replace that text with another text. The text to search for is in exfile2 and the replacement text is in exfile3. I work with kornshell under AIX and need to do this with a lot of files. (the file type is postscript and they need... (10 Replies)
Discussion started by: marz
10 Replies

3. Shell Programming and Scripting

Perl: Search for string on line then search and replace text

Hi All, I have a file that I need to be able to find a pattern match on a line, search that line for a text pattern, and replace that text. An example of 4 lines in my file is: 1. MatchText_randomNumberOfText moreData ReplaceMe moreData 2. MatchText_randomNumberOfText moreData moreData... (4 Replies)
Discussion started by: Crypto
4 Replies

4. Shell Programming and Scripting

reverse search a text file from a specified line

Hello All, I have a following task that I need to accomplish through a script or program and I am looking for some help as I have exhausted my ideas. 1. given: a text file with thousands of lines 2. find: pattern A in file and get line number ( grep -n works) 3. find: the first occurence of... (14 Replies)
Discussion started by: PacificWonder
14 Replies

5. Shell Programming and Scripting

Search text from a file and print text and one previous line too

Hi, Please let me know how to find text and print text and its previous line. Please don't get irritated few days back I asked text and next line. I am using HP-UX 11.11 Thanks for your help. (6 Replies)
Discussion started by: kamranjalal
6 Replies

6. UNIX for Dummies Questions & Answers

search all file for particular text and make changes to line 3

Hi All, I am sitting on HPUX. I want to change the exit into #exit, which appears into 3red line of code in shell scripting, wondering how shell script to be called up to perform action. I have following code in all files. Now, I need to find the text exit and replace into #exit. #!/sbin/sh... (10 Replies)
Discussion started by: alok.behria
10 Replies

7. UNIX for Dummies Questions & Answers

VIM search and replace with line breaks in both the target and replacement text

Hi, Ive spent ages trying to find an explanation for how to do this on the web, but now feel like I'm :wall: I would like to change each occurence (there are many within my script) of the following: to in Vim. I know how to search and replace when it is just single lines... (2 Replies)
Discussion started by: blueade7
2 Replies

8. Shell Programming and Scripting

PERL or SHELL Scrript to search in Directories by taking line by line from a text file

Unix box server version *********** >uname -r B.11.00 >echo $SHELL /usr/bin/ksh --> in this server, I have the path like /IMbuild/dev/im0serv1 ---> in that directory I have the folders startup(.jsp files nearly 100 jsp's ) and scripts(contains .js files nearly 100 files) ... (9 Replies)
Discussion started by: pasam
9 Replies

9. Shell Programming and Scripting

Search text and replace line next to it

I have a file which requires modification via a shell script. Need to do the following: 0. take input from user for new text. 1. search for a keyword in the file. 2. replace the line next to this to this keyword with user supplied input. for e.g., my file has the following text: (some... (7 Replies)
Discussion started by: chingupt
7 Replies

10. Shell Programming and Scripting

Search and Replace a text if the line contains a pattern

My text file looks like below . . . abcdefghi jklmnop $Bad_ptrq_GTS=rcrd_ip.txt $Bad_abcd_REJ=rcrd_op.txt ghijklm $Bad_abcd_TYHS=rcrd_op.txt abcgd abcdefghi jklmnop $Bad_ptrq_GTS=rcrd_ip.txt (2 Replies)
Discussion started by: machomaddy
2 Replies
RDF::Query::Plan::Join(3pm)				User Contributed Perl Documentation			       RDF::Query::Plan::Join(3pm)

NAME
RDF::Query::Plan::Join - Join query plan base class. VERSION
This document describes RDF::Query::Plan::Join version 2.908. METHODS
Beyond the methods documented below, this class inherits methods from the RDF::Query::Plan class. "new ( $lhs, $rhs, $optional )" "lhs" Returns the left-hand-side plan to the join. "rhs" Returns the right-hand-side plan to the join. "optional" "bf ()" Returns a string representing the state of the nodes of the triple (bound or free). "join_classes" Returns the class names of all available join algorithms. "distinct" Returns true if the pattern is guaranteed to return distinct results. "ordered" Returns true if the pattern is guaranteed to return ordered results. "plan_prototype" Returns a list of scalar identifiers for the type of the content (children) nodes of this plan node. See RDF::Query::Plan for a list of the allowable identifiers. "plan_node_data" Returns the data for this plan node that corresponds to the values described by the signature returned by "plan_prototype". AUTHOR
Gregory Todd Williams <gwilliams@cpan.org> perl v5.14.2 2012-01-31 RDF::Query::Plan::Join(3pm)
All times are GMT -4. The time now is 12:40 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy