Sponsored Content
Top Forums Shell Programming and Scripting [Bash]Attempting to Merge text from one file into another file at the line directly under a word Post 302423885 by Scrutinizer on Sunday 23rd of May 2010 05:13:32 AM
Old 05-23-2010
Alternatively:
Code:
$ cat transrep
List of successful transfers:

List of unsuccessful transfers:

Code:
$ cat succtrans
bcde
fghi
jklmn

Code:
$ cat failtrans
zyxw
vuts
rqpon

Code:
$ sed -e '/List of successful transfers:/r succtrans' -e '/List of unsuccessful transfers:/r failtrans' transrep

Code:
List of successful transfers:
bcde
fghi
jklmn

List of unsuccessful transfers:
zyxw
vuts
rqpon

This User Gave Thanks to Scrutinizer For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can a shell script pull the first word (or nth word) off each line of a text file?

Greetings. I am struggling with a shell script to make my life simpler, with a number of practical ways in which it could be used. I want to take a standard text file, and pull the 'n'th word from each line such as the first word from a text file. I'm struggling to see how each line can be... (5 Replies)
Discussion started by: tricky
5 Replies

2. Shell Programming and Scripting

How to merge multiline into line begining with specific word

Hi, The file format is like the following. timestamp=2008-02-28-23.50.29.550675;category=CONTEXT;audit event=CONNECT; event correlator=2; database=CURDOMS;userid=inst3;authid=INST3; origin node=0;coordinator node=0; application id=AC122081.FA97.054468155029;application... (2 Replies)
Discussion started by: missyou
2 Replies

3. Shell Programming and Scripting

BASH: Grepping/sedding/etc out part of a file... (from one word to 'blank' line)

I have a file that lists data about a system. It has a part that can look like: the errors I'm looking for with other errors: Alerts Password Incorrect Login Error Another Error Another Error 2 Other Info or, just the errors I need to parse for: Alerts Password Incorrect ... (9 Replies)
Discussion started by: elinenbe
9 Replies

4. Shell Programming and Scripting

Help need to cut the first word of a line in text file

Hi All, I would like help with a script which can get rid of the first work of all lines in text file. File 1 The name is Scott. Output : name is Scott ---------- Post updated at 02:38 PM ---------- Previous update was at 02:37 PM ---------- Hi ALL There is typo error in... (3 Replies)
Discussion started by: bubbly
3 Replies

5. Shell Programming and Scripting

How to find and print the last word of each line from a text file

Can any one help us in finding the the last word of each line from a text file and print it. eg: 1st --> aaa bbbb cccc dddd eeee ffff ee 2nd --> aab ered er fdf ere ww ww f the o/p should be a below. ee f (1 Reply)
Discussion started by: naveen_sangam
1 Replies

6. Shell Programming and Scripting

get the fifth line of a text file into a shell script and trim the line to extract a WORD

FOLKS , i have a text file that is generated automatically of an another korn shell script, i want to bring in the fifth line of the text file in to my korn shell script and look for a particular word in the line . Can you all share some thoughts on this one. thanks... Venu (3 Replies)
Discussion started by: venu
3 Replies

7. Shell Programming and Scripting

Grep to isolate a text file line and Awk to select a word?

I am looking at using grep to locate the line in the text file and them use awk to select a word or words out of it. I know awk needs -v to allow a variable to be used, but also needs -F to allow the break up of the sentence and allow the location of separate variables. $line = grep "1:" File |... (8 Replies)
Discussion started by: Ironguru
8 Replies

8. UNIX Desktop Questions & Answers

Merge Last Word to Another File

Hi, Im a newbie to scripting. I have a file that looks like the one below. How can i change the last "/" to become a space. Thank You so Much for the help. :) hostname date Feb-9 /u100/DEVCO/Patching/a.log hostname date Jun-25 /u100/DEVCO/DumpCleaner/a.log hostname date Jun-25... (2 Replies)
Discussion started by: lienyca
2 Replies

9. Shell Programming and Scripting

Read a File line by line and split into array word by word

Hi All, Hope you guys had a wonderful weekend I have a scenario where in which I have to read a file line by line and check for few words before redirecting to a file I have searched the forum but,either those answers dint work (perhaps because of my wrong under standing of how IFS... (6 Replies)
Discussion started by: Kingcobra
6 Replies

10. Shell Programming and Scripting

"Content-type: text/html No input file specified." Only in CRON but not when executed directly

Hi gang, I have the following code inside a the file script.sh #!/bin/bash todaysdate=$(date --date='7 day' +'%d') todaysmonth=$(date +'%m') todaysyear=$(date +'%Y') yahoodatestring=$todaysyear$todaysmonth$todaysdate nicedate=$(date --date='5 day' +'%A') nice="$nicedate,... (2 Replies)
Discussion started by: phpchick
2 Replies
ECACCESS-ECTRANS-LIST(1p)				User Contributed Perl Documentation				 ECACCESS-ECTRANS-LIST(1p)

NAME
ecaccess-ectrans-list - List all ECtrans transfers SYNOPSIS
ecaccess-ectrans-list -version|-help|-manual ecaccess-ectrans-list [-debug] [ectrans-id] DESCRIPTION
List all the ECtrans transfers in the ECtrans Spool. When an ectrans-id is specified then the details for this transfer are displayed. The Transfer statuses can have the following values: INIT Files are being transferred to the spool. COPY Files are being transferred to the remote site. WAIT Files are scheduled and waiting to be started. RETR File transfer will be retried. STOP Files have NOT been successfully transferred (error). DONE Files have been successfully transferred. ARGUMENTS
ectrans-id (optional) The name of the ECtrans transfer to retrieve the details. OPTIONS
-version Display version number and exits. -help Print a brief help message and exits. -manual Prints the manual page and exits. -debug Display the SOAP messages exchanged. EXAMPLES
ecaccess-ectrans-list 124356 Give the informations concerning the ECtrans transfer 124356. ecaccess-ectrans-list List all the ECtrans transfers in the Spool. SEE ALSO
ecaccess-ectrans-delete, ecaccess-ectrans-request, ecaccess-ectrans-restart and ecaccess. perl v5.14.2 2012-04-16 ECACCESS-ECTRANS-LIST(1p)
All times are GMT -4. The time now is 12:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy