Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Display multiple output lines Post 302118506 by kingofprussia on Tuesday 22nd of May 2007 12:13:03 PM
Old 05-22-2007
Display multiple output lines

All,

I have a file ABC.TXT which has two records:

12345 19.93 34.94
12345 94.84 10.48


If do the following command and

grep '12345' ABC.TXT >> test1.txt

If I look at the output of test1.txt I appears as follows:

12345 19.93 34.94 12345 94.84 10.48

I need the output to appear in the output file as

12345 19.93 34.94
12345 94.84 10.48

Any help is greatly appreciated

Thanks
KP
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

using tr to put multiple lines of output into one line

Hi all, For a intro UNIX course I'm taking, I need to use the command "tr" to display a file on standard output without any newlines (all on one line). I assume I would start with "cat filename | tr" but don't know what to put after tr. Any ideas would be lovely! Thanks. (3 Replies)
Discussion started by: otes4
3 Replies

2. Shell Programming and Scripting

Script to display record spanning over multiple lines

Following are the lines from /etc/sudoers.conf bob SPARC = (OP) ALL : SGI = (OP) ALL fred ALL = (DB) NOPASSWD: ALL ALL CDROM = NOPASSWD: /sbin/umount /CDROM,\ /sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM Could you please help me with shell/perl script to display the records with... (2 Replies)
Discussion started by: Ujan
2 Replies

3. Shell Programming and Scripting

How do I capture multiple lines of the status output of a command?

I need to know what the upload speed of an Internet connection. I thought the easiest way to do this would be to transfer a file via FTP to my server using the command: sh-3.2$ ftp -u ftp://username:password@computerdomain/directory/ file_to_be_uploaded Note: My environment allows me to issue... (2 Replies)
Discussion started by: zzz1528
2 Replies

4. Shell Programming and Scripting

Cut display multiple lines of output

I have a script that runs a command, and the output is on multiple lines. The fields are delimited by '='. I need the 8th column from the first line and the 2nd from the second line, but I can't figure out how to display the second line. command1 | cut -d '=' -f 8 The above gets me what I... (2 Replies)
Discussion started by: cbo0485
2 Replies

5. Shell Programming and Scripting

Find multiple patterns on multiple lines and concatenate output

I'm trying to parse COBOL code to combine variables into one string. I have two variable names that get literals moved into them and I'd like to use sed, awk, or similar to find these lines and combine the variables into the final component. These variable names are always VAR1 and VAR2. For... (8 Replies)
Discussion started by: wilg0005
8 Replies

6. Shell Programming and Scripting

Grep multiple line pattern and output the lines

Hi I have the following Input -- -- TABLE: BUSINESS_UNIT -- ALTER TABLE RATINGS.BUSINESS_UNIT ADD CONSTRAINT FK1_BUSINESS_UNIT FOREIGN KEY (PEOPLESOFT_CHART_FIELD_VALUE_ID) REFERENCES RATINGS.PEOPLESOFT_CHART_FIELD_VALUE(PEOPLESOFT_CHART_FIELD_VALUE_ID) ; ALTER TABLE... (1 Reply)
Discussion started by: pukars4u
1 Replies

7. UNIX Desktop Questions & Answers

Display a specific words from a multiple lines

well, i am so not familiar with this kind of things but i am gonna explain extactly what i am looking for so hopfully someone can figure it out :) i have a command that shows memory usage besides the process name, for example(the command output): 500 kb process_1 600 kb process_2 700 kb... (4 Replies)
Discussion started by: Portabello
4 Replies

8. UNIX for Dummies Questions & Answers

Capture Multiple Lines Into Variable As Of Standard Output

Hello All, I have the below script and output. cat test.sh #!/bin/bash -x logit() { echo " - ${*}" > ${LOG_FILE} } LOG_FILE=/home/infrmtca/bin/findtest.log VAR=`find . -type f -name "*sql"` logit $VAR Output: cat /home/infrmtca/bin/findtest.log -... (9 Replies)
Discussion started by: Ariean
9 Replies

9. Shell Programming and Scripting

Grep multiple exact match, do not display lines

Hi, Need help to grep the following from a file x. I just want to grep exact match not lines and not partial word. CONFSUCCESS CONFFAIL CONFPARTIALSUCCESS >cat x xczxczxczc zczczcxx CONFSUCCESS czczczcczc czxxczxzxczcczc CONFFAIL xczxczcxcczczc zczczczcz CONFPARTIALSUCCESS czczxcxzc ... (4 Replies)
Discussion started by: rajeshwebspere
4 Replies

10. Shell Programming and Scripting

Grep and display multiple lines

Hi guys, I have a log file that generates multiple logs about a query. <query time='2016-04-13 13:01:50.825'> <PagingRequestHandler> <Before>brand:vmu</Before> <After>brand:vmu</After> </PagingRequestHandler> <GroupDeviceFilterHandler> <Before>brand:vmu</Before> ... (3 Replies)
Discussion started by: Junaid Subhani
3 Replies
cdc(1)							      General Commands Manual							    cdc(1)

Name
       cdc - change delta commentary of an SCCS file

Syntax
       cdc -rSID [-m[mrlist]]  [-y[comment]] files

Description
       The command changes the delta commentary of each named SCCS file, for the SID specified by the -r option.

       The  delta  commentary  is  defined to be the Modification Request (MR) and comment information usually specified by the command (-m and -y
       options).

       The commentary may consist of one or more lines, terminated by a dot in column one of a new line.

       If a directory is named, behaves as though each file in the directory were specified as a named file, except non-SCCS files (last component
       of the path name does not begin with s.)  and unreadable files, which are silently ignored.  If a name of - is given, the standard input is
       read (see RESTRICTIONS).  Each line of the standard input is taken to be the name of an SCCS file to be processed.

       Arguments to which may appear in any order, consist of option arguments, and file names.

       All the described option arguments apply independently to each named file.

Options
       -m[mrlist]     Adds or deletes modification numbers.  If the SCCS file has the v flag set then a list of MR  numbers  to  be  added  and/or
		      deleted  in the delta commentary of the SID specified by the -r option may be supplied.  For further information, see A null
		      MR list has no effect.

		      MR entries are added to the list of MRs in the same manner as that of In order to delete an MR, precede the MR  number  with
		      the  character  ! (see Examples).  If the MR to be deleted is currently in the list of MRs, it is removed and changed into a
		      comment line.  A list of all deleted MRs is placed in the comment section of the delta commentary and is preceded by a  com-
		      ment line stating that they were deleted.

		      If  -m  is not used and the standard input is a terminal, the prompt MRs?  is issued on the standard output before the stan-
		      dard input is read.  If the standard input is not a terminal, no prompt is issued.  The MRs? prompt always precedes the com-
		      ments? prompt (see -y option).
		      MRs in a list are separated by blanks and/or tab characters.  An unescaped new-line character terminates the MR list.

		      Note  that  if  the v flag has a value it is taken to be the name of a program (or shell procedure) which validates the cor-
		      rectness of the MR numbers.  For further information, see If a nonzero exit status is returned from the MR number validation
		      program, terminates and the delta commentary remains unchanged.

       -rSID	      Specifies the SCCS Identification string of a delta for which the delta commentary is to be changed.

       -y[comment]    Replaces	existing  commentary  for  the delta specified by the -r option.  The previous comments are kept and preceded by a
		      comment line stating that they were changed.  A null comment has no effect.

		      If -y is not specified and the standard input is a terminal, the prompt comments? is issued on the  standard  output  before
		      the standard input is read; if the standard input is not a terminal, no prompt is issued.  A dot in column one of a new line
		      terminates the comment text.

       Certain permissions are necessary to modify the SCCS file; generally, however, if you made the delta, you can change its delta  commentary,
       and if you own the file and directory you can modify the delta commentary.

Examples
       This example shows how to add bl78-12345 and bl79-00001 to the MR list, remove bl77-54321 from the MR list, and add the comment ``trouble''
       to delta 1.6 of s.file.
       sccscdc -r1.6 -m"bl78-12345 !bl77-54321 bl79-00001" -ytrouble .file

       This example does the same thing.
       sccscdc -r1.6 .file

       -MRs? !bl77-54321 bl78-12345 bl79-00001

       comments? trouble

Restrictions
       If SCCS file names are supplied to the command via the standard input (- on the command line), then the -m and  -y  options  must  also	be
       used.

Diagnostics
       See for explanations.

Files
       For more information, see

       For more information, see

See Also
       admin(1), delta(1), get(1), help(1), prs(1), sccs(1), sccsfile(5)
       Guide to the Source Code Control System

																	    cdc(1)
All times are GMT -4. The time now is 06:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy