I have a file that contains the following:
:@:176:@:4:@:name:@:file:@:this is
a summary:@:description can be
long but who knows
can even have <br> tags.:@:how to:@:type:@:18544:@:550:@:400:END:
:@:177:@:9:@:name:@:file:@:summary:@:this
will containg... (18 Replies)
Hi,
I've some files with the following data and i need to convert the lines between the separator ---, into a single line. I've tried with the paste cmd but my main problem is that the number of lines between the separator is not fix, it can very between 1-4 lines.
Input
---
2010-02-22... (4 Replies)
This is related to one of my previous post but now with a slight difference: I need the "Updated:" to be in one line as well as the "Information:" on one line as well. These are in multiple lines right now as seen below. These can have 2 or more lines that needs to be in one line.
System name:... (8 Replies)
Hi,
I have a requirement with,
No~Dt~Notes
1~2011/08/1~"aaa
bbb
ccc
ddd
eee
fff
ggg
hhh"
Single column alone got splitted into multiple lines.
I require the output as
No~Dt~Notes
1~2011/08/1~"aaa<>bbb<>ccc<>ddd<>eee<>fff<>ggg<>hhh"
mean to say those new lines to be... (1 Reply)
Hi,
1. Each message starts with date
2. There is blank line between each message
3. Each message does not contain same number of lines.
Any help in merging multiple lines in each message to a single line is much appreciated.
AIX: Korn Shell
Error log file looks like below.
... (5 Replies)
Hi All,
I have a spool file which as shown below. I want to make it as single line after every semicolon. In this case there should be 2 lines in vi editor.
I am not used to use sed so could you guys please help me out ?
exec spk_dba.sp_runsql('ALP','CREATE DATABASE LINK "TEST" CONNECT TO... (2 Replies)
Hi all,
I have a requirement to covert multiple lines in a comma delimited file to a single line through shell scripting. We should compare the data in the first column in each line. If it is same, then the other data should be put in the same line.Below is the sample input and expected output:... (4 Replies)
Hi all, I'm relatively new to scripting, I can do pretty basic things. I have a daily log file that looks like:
timestamp=2017-06-28-01.01.35.080576;
event status=0;
userid=user1;
authid=user1;
application id=10.10.10.10.11111.12345678901;
application name=GUI;
... (29 Replies)
I have code as below
# create temporary table `temp4277`(key(waybill_no))
select waybill_no,concat_ws('',card_type,card_series_no) cardinfo
from rfid_temp_ticket where waybill_no='4277'
group by... (4 Replies)
Discussion started by: kaushik02018
4 Replies
LEARN ABOUT OPENSOLARIS
paste
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)