Sponsored Content
Top Forums Shell Programming and Scripting Script to get required output from textfile Post 302768880 by balajesuri on Sunday 10th of February 2013 07:43:52 AM
Old 02-10-2013
Could you please paste a few lines from your input file for a sample?
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

formatting textfile inside ksh script using awk not working

I cannot seem to get this text file to format. Its as if the awk statement is being treated as a simple cat command. I manned awk and it was very confusing. I viewed previous posts on this board and I got the same results as with the the awk command statement shown here. Please help. ... (6 Replies)
Discussion started by: tekline
6 Replies

2. Shell Programming and Scripting

help me how to use nawk for required output

Hi all i have 2 input files 1st file is N1 | N2|N3|N4|N5|N6|N7|N8|N9 4041491000|245160|1|0|0|1|0|0|0 4041401505|152178|1|1|1|1|0|0|0 4041450004|014052|1|1|1|1|0|0|0 4041450005|580916|1|1|1|1|0|0|0 4041491000|230990|1|0|1|1|0|0|0 4041460001|338317|1|1|1|1|0|0|0 2nd file N1 |... (8 Replies)
Discussion started by: dodasajan
8 Replies

3. Shell Programming and Scripting

how to get the correct alignment in a textfile to a mail using shell script?

Hi All, Can any one solve this prob. Im sending a textfile content as a mail body while sending a mail using shell script. But, that textfile content is a unic command output. So, in mail, im not getting the correct alignment as in textfile. What may be the reason behind this. Can... (1 Reply)
Discussion started by: suman_dba1
1 Replies

4. Shell Programming and Scripting

output required

Hi I have the following output Message man amm (9196) is calling Hello & Alert man amtrr (9197) is stopped Find amfi (19198) is cancelled Engine Item aea (19203) is notified Engine Item2 aea2 ... (8 Replies)
Discussion started by: PrasannaKS
8 Replies

5. Shell Programming and Scripting

perl required output

Hi, I have a string in log file from that i need to pick the username. the string is like this-- pid 2172 tid 3124: 160: 10110847: userName : pid 2172 tid 3124: 160: 10110847: userName : pid 2172 tid 3124: 160: 10110847: userName : pid 2172 tid 3124: 160: 10110847: userName : pid... (5 Replies)
Discussion started by: namishtiwari
5 Replies

6. Shell Programming and Scripting

Regarding overwriting the textfile with output what we get!

Hi freinds, My problem is I have a script which is used for our office work... in that with my userid i can append the LOGFILE with the output which i get while running the script.. for this i use the below command output >> $LOGFILE but with the same script my colleague is... (6 Replies)
Discussion started by: smarty86
6 Replies

7. UNIX for Dummies Questions & Answers

Script to add text before the first word on a line in a textfile.

How can i make a script to add text before the first word on a line in a textfile : Example: Old line: is my place New line: this is my place Please use and tags when posting code, data or logs etc. to preserve formatting and enhance readability, thanks. (3 Replies)
Discussion started by: mjanssen
3 Replies

8. Shell Programming and Scripting

script to mail monitoring output if required or redirect output to log file

Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions. ... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

9. Ubuntu

Top output to textfile not working in cronjob

Hello, If i run the following script from the cmdline it works just fine however if i run it via root cronjob it doesn't write to the file at all. It is chmod 777 now so shouldnt be any right issues. Shellscript looks like this: /usr/bin/top -b -n 1 -u nagios >> /var/log/test.log Cronjob... (7 Replies)
Discussion started by: heady89
7 Replies

10. Shell Programming and Scripting

How to separate sorte different characters from one textfile and copy them in a new textfile?

My first post, so don't kill me :) Say i open some textfile with some example like this. on the table are handy, bread and wine Now i know exactly what is in and i want to separate and sorted it in terminal to an existing file with another 2 existing lines in like this: table plane ... (3 Replies)
Discussion started by: schwatter
3 Replies
paste(1)							   User Commands							  paste(1)

NAME
paste - merge corresponding or subsequent lines of files SYNOPSIS
paste [-s] [-d list] file... DESCRIPTION
The paste utility will concatenate the corresponding lines of the given input files, and write the resulting lines to standard output. The default operation of paste will concatenate the corresponding lines of the input files. The NEWLINE character of every line except the line from the last input file will be replaced with a TAB character. If an EOF (end-of-file) condition is detected on one or more input files, but not all input files, paste will behave as though empty lines were read from the files on which EOF was detected, unless the -s option is specified. OPTIONS
The following options are supported: -d list Unless a backslash character () appears in list, each character in list is an element specifying a delimiter character. If a backslash character appears in list, the backslash character and one or more characters following it are an element specifying a delimiter character as described below. These elements specify one or more delimiters to use, instead of the default TAB character, to replace the NEWLINE character of the input lines. The elements in list are used circularly. That is, when the list is exhausted, the first element from the list is reused. When the -s option is specified: o The last newline character in a file will not be modified. o The delimiter will be reset to the first element of list after each file operand is processed. When the option is not specified: o The NEWLINE characters in the file specified by the last file will not be modified. o The delimiter will be reset to the first element of list each time a line is processed from each file. If a backslash character appears in list, it and the character following it will be used to represent the following delimiter characters: Newline character. Tab character. \ Backslash character. Empty string (not a null character). If is immediately followed by the character x, the character X, or any charac- ter defined by the LC_CTYPE digit keyword, the results are unspecified. If any other characters follow the backslash, the results are unspecified. -s Concatenate all of the lines of each separate input file in command line order. The NEWLINE character of every line except the last line in each input file will be replaced with the TAB character, unless otherwise specified by the -d option. OPERANDS
The following operand is supported: file A path name of an input file. If - is specified for one or more of the files, the standard input will be used. The standard input will be read one line at a time, circularly, for each instance of -. Implementations support pasting of at least 12 file operands. USAGE
See largefile(5) for the description of the behavior of paste when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). EXAMPLES
Example 1 Listing a directory in one column example% ls | paste -d" " - Example 2 Listing a directory in four columns example% ls | paste - - - - Example 3 Combining pairs of lines from a file into single lines example% paste -s -d" t n" file ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of paste: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWesu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
cut(1), grep(1), pr(1), attributes(5), environ(5), largefile(5), standards(5) DIAGNOSTICS
"line too long" Output lines are restricted to 511 characters. "too many files" Except for -s option, no more than 12 input files may be specified. "no delimiters" The -d option was specified with an empty list. "cannot open file" The specified file cannot be opened. SunOS 5.11 20 Dec 1996 paste(1)
All times are GMT -4. The time now is 10:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy