Sponsored Content
Top Forums Shell Programming and Scripting split single line into two line or three lines Post 302411243 by ygemici on Thursday 8th of April 2010 04:27:54 AM
Old 04-08-2010
MySQL

Code:
[root@sistem1lnx tes1]# cat 2
test,DEMTEMPUT20100404010012,,,,,,,,|0070086|0070087,

[root@sistem1lnx tes1]# sed -e 's/\([[:graph:]][[:graph:]].*\)/\1\n\1/' -e 's/\([[:graph:]][[:graph:]]*\)|\([0-9][0-9]*\)|\([0-9][0-9]*\)/\1\2/' -e 's/\([[:graph:]][[:graph:]]*\)|\([0-9][0-9]*\)|\([0-9][0-9]*\)/\1\3/' 2
test,DEMTEMPUT20100404010012,,,,,,,,0070086,
test,DEMTEMPUT20100404010012,,,,,,,,0070087,

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need output in different lines not in one single line

I am getting the coutput like this as show below in one single line, where as the command is executed is several lines and the output should also be requied in several lines, not in one single line. Anyone any idea? p4 opened -a | grep *locked* | awk '{ printf $8 }' >/tmp/aa $ cat... (1 Reply)
Discussion started by: csaha
1 Replies

2. Shell Programming and Scripting

Break lines up into single lines after each space in every line

It sounds a bit confusing but what I have is a text file like the example below (without the Line1, Line2, Line3 etc. of course) and I want to move every group of characters into a new line after each space. Example of text file; line1 .digg-widget-theme2 ul { background: rgb(0, 0, 0) none... (7 Replies)
Discussion started by: lewk
7 Replies

3. Shell Programming and Scripting

Multiple lines into a single line

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)
Discussion started by: RickyC9999
4 Replies

4. Shell Programming and Scripting

Split line in to 3 lines

Hi, I have a file which contains 1000's of lines. Each line is a log which is pretty long. So i want to split the each line based on 3 category. 1> Date 2><REQUEST> 3><RESPONSE> So below is the example of a line. 2010-11-16 00:45:12,314<REQUEST><VALIDATION-ERROR><soapenv:Envelope... (16 Replies)
Discussion started by: raghunsi
16 Replies

5. Shell Programming and Scripting

Split a single record to multiple records & add folder name to each line

Hi Gurus, I need to cut single record in the file(asdf) to multile records based on the number of bytes..(44 characters). So every record will have 44 characters. All the records should be in the same file..to each of these lines I need to add the folder(<date>) name. I have a dir. in which... (20 Replies)
Discussion started by: ram2581
20 Replies

6. Shell Programming and Scripting

Split the a single line into two

Hi all, I wanted to split a single line into two line. For example: A/B/C 10 i want this output var1 = A/B/C var2 = 10 How do i get this. (2 Replies)
Discussion started by: ch33ry
2 Replies

7. Shell Programming and Scripting

Multiple lines in a single column to be merged as a single line for a record

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)
Discussion started by: Bhuvaneswari
1 Replies

8. Shell Programming and Scripting

Write the lines in one single line

Hi, I need some iteration to do the following work. Sample: ANS|26-Jan-2012|26|MON|12536.1 ANS|26-Jan-2012|26|TUE|2536.1 ANS|26-Jan-2012|26|THUR|789.1 SED|26-Jan-2013|32|MON|258.1 SED|26-Jan-2013|32|TUE|369.1 SED|26-Jan-2013|32|THUR|2145.1 OUTPUT: ... (3 Replies)
Discussion started by: anshaa
3 Replies

9. Shell Programming and Scripting

How do I split a single-line input into five lines?

Example input: John:Shepherd:770-767-4040:U.S.A:New York Mo Jo:Jo Jo: 666-666-6666:U.S.A:Townsville Expected Output: First Name: John Last Name: Shepherd Phone Number: 770-767-4040 Country: U.S.A State: New York First Name: Mo Jo Last Name: Jo Jo Phone Number: 666-666-6666... (10 Replies)
Discussion started by: Camrikron
10 Replies

10. UNIX for Beginners Questions & Answers

Get an output of lines in pattern 1st line then 10th line then 11th line then 20th line and so on.

Input file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies
BCOMPS(1)						      General Commands Manual							 BCOMPS(1)

NAME
bcomps - biconnected components filter for graphs SYNOPSIS
bcomps [ -stvx? ] [ -ooutfile ] [ files ] DESCRIPTION
bcomps decomposes graphs into their biconnected components, printing the components to standard output. OPTIONS
The following options are supported: -s No output graph is printed. Implies the -v flag. -t Print the underlying block-cutvertex tree. -x Each biconnected component is printed as a separate root graph. -v Prints number of blocks and cutvertices. -o outfile If specified, each root graph will be written to a different file with the names derived from outfile. In particular, if both -o and -x flags are used, then each block is written to a different file. If outfile does not have a suffix, the nth block of the ith graph is written to outfile_n_i. However, the 0th block of the 0th graph is written to outfile. If outfile has a suffix, i.e., has the form base.sfx, then the files will have the same name as above, except appended with .sfx. The block-cutvertex tree of ith graph is written to outfile_n_T, with an appended suffix if specified. By default, each input graph is printed, with each block given as a subgraph whose name is a concatenation of the name of the input graph, the string "_bcc_" and the number of the block. OPERANDS
The following operand is supported: files Names of files containing 1 or more graphs in dot format. If no files operand is specified, the standard input will be used. RETURN CODES
bcomps returns 0 if all the input graphs are biconnected; and non-zero if any graph has multiple blocks, or any error occurred. BUGS
It is possible, though unlikely, that the names used for connected components and their subgraphs may conflict with existing subgraph names. AUTHORS
Emden R. Gansner <erg@research.att.com> SEE ALSO
ccomps(1), gc(1), dot(1), gvpr(1), gvcolor(1), acyclic(1), sccmap(1), tred(1), libgraph(3) 18 November 2003 BCOMPS(1)
All times are GMT -4. The time now is 09:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy