Sponsored Content
Full Discussion: replace space with new line
Top Forums Shell Programming and Scripting replace space with new line Post 302201948 by dakid on Tuesday 3rd of June 2008 01:06:31 PM
Old 06-03-2008
replace space with new line

i have a file named as templist which looks like this:

Quote:
00121575.000000 02361356.000000 99319704.000000 00497959.000000
i want to translate spaces to a new line so that the file would look like this

Quote:
00121575.000000
02361356.000000
99319704.000000
00497959.000000
im using sed with this sed -e 's/" "/\n/' templist > templist.out but it doesn't work. can someone please help me.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace space, that is not in html tags <> with new line using sed

Hi, I am working on transforming html code text into the .vert text format. I want to use linux utility sed. I have this regexp which should do the work: s/ \(?!*>\)/\n/g. I use it like this with sed: echo "you <we try> there" | sed 's/ \(?!*>\)/\n/g' ... The demanded output should be: you <we... (5 Replies)
Discussion started by: matt1311
5 Replies

2. Shell Programming and Scripting

replace space or spaces in a line of a file with a single :

I am searching while I await a response to this so if it has been asked already I apologize. I have a file with lines in it that look like: bob johnson email@email.org I need it to look like: bob:johnson:email@email.org I am trying to use sed like this: sed -e 's/ /:/g' file >... (5 Replies)
Discussion started by: NewSolarisAdmin
5 Replies

3. Shell Programming and Scripting

gnu sed replace space with new line

please help in making sed singleline command i need to insert dos new line (CR LF) before " 34 matching device(s) found on \\cpu1." " 6 matching device(s) found on \\cpu7." " 102 matching device(s) found on \\mainserver." the problem is that sometimes there are both CR LF before strings and... (1 Reply)
Discussion started by: xserg
1 Replies

4. Shell Programming and Scripting

how to replace new line ( \n ) with space or Tab in Sed

Hi, how to replace new line with tab in sed ... i used sed -e 's/\n/\t/g' <filename > but its not working (1 Reply)
Discussion started by: mail2sant
1 Replies

5. Shell Programming and Scripting

Replace long space to become one space?

Hi, i have the log attached. Actually i want the long space just become 1 space left like this : Rgds, (12 Replies)
Discussion started by: justbow
12 Replies

6. Shell Programming and Scripting

Stripping out more than a space from a line, but keep single space.

Hi all, Is there a way to perform the above, I am trying to strip out more than one space from a line, but keep the single space. See below output example. My Name is test test2 test3 test4 test5 My Name is test test2 test3 test4 test5 Please note that the lines would contain... (7 Replies)
Discussion started by: eo29
7 Replies

7. Shell Programming and Scripting

sed : replace space and end-of-line

Hi ! I'm rather new with sed ... learned a lot already by googling etc ... The following script should replace all spaces and ends-of-lines with "something (see below). #!/bin/bash i=0 while read line do fam="H`printf "%06d" $i`" echo $line | sed -e 's//\t'$fam'\n/g' i=$(($i+1))... (7 Replies)
Discussion started by: jossojjos
7 Replies

8. Shell Programming and Scripting

Replace end of line with a space

for eg: i have i/p file as: ================ i wnt to change end of line ================= my require ouput is like: i wnt to change end of line ==================== (7 Replies)
Discussion started by: RahulJoshi
7 Replies

9. Shell Programming and Scripting

In vi editor I want to replace next line char by space

in vi editor I want to replace next line char by space help me eg: input: 123 123 123 output: 123 123 123 (5 Replies)
Discussion started by: RahulJoshi
5 Replies

10. Shell Programming and Scripting

SED - insert space at the beginning of line and multi replace command

hi I am trying to use SED to replace the line matching a pattern using the command sed 'pattern c\ new line ' <file1 >file 2 I got two questions 1. how do I insert a blank space at the beginning of new line? 2. how do I use this command to execute multiple command using the -e... (5 Replies)
Discussion started by: piynik
5 Replies
discgrp(5gv)						     Geometry Project Programs						      discgrp(5gv)

NAME
discrete group file formats SYNOPSIS
An ascii file representation of a discrete geometric group. SUMMARY
This file format applies to a wide variety of groups encountered in topology and geometry. At the beginning of the file is the string DIS- CGRP, in conformity with other OOGL file formats (see oogl(5)). The remainder of the file is a series of parenthesized expressions. The file format is based on an expandable set of key markers and values. A typical entry would be (group borromean ) where parentheses enclose the expression. The string 'group' is called the key marker. The remaining text contains a value, in this case a character string which is the name of the group. Key markers currently recognized and their values include: group A name for this group. comment An arbitrary comment [maximum length 256 bytes] [must be enclosed in double quotes] attribute One of a several keyword identifiers including: euclidean is a euclidean group hyperbolic is a hyperbolic group spherical is a spherical group transposed the matrices are transposed finite this is a finite group model In the case that 'hyperbolic' is an attribute, and the dimension is three, this keyword sets the model that is expected for reading subsequent isometries, i.e., expects elements of SL(2,C) if the model is upperhalfspace or conformalball and O(3,1,R) if it is projective. projective default upperhalfspace conformalball [not currently implemented] display These values set characteristics of the the display of the discrete group. centercam keeps the camera centered in central dirichlet domain. zcull removes tiles which lie behind the camera. showcam if centercam is set, displays camgeom, if provided (see below). dimn The dimension of the space. ngens Number of generators. gens List of generators. nels Number of group elements. els List of group elements. wafile Word acceptor file (in DEAGL format version 2.2) camgeom An OOGL-format geometry description to represent the observer. geom An OOGL-format geometry description. Will replace the default Dirichlet domain computation. String-matching of key markers and attribute values is case-insensitive. Currently all matrices must be 4x4 real matrices. Hence the only valid dimensions are 2,3, or 4. The typical case is dimension 3 where there are projective models for hyperbolic, euclidean, and spherical geometry. Dimension 2 groups should leave the z-coordinate unchanged. Matrices are considered transposed if they are considered to act on column vectors as in: M.v = v'. This is the usual mathematical conven- tion convention. So, if you use this convention you must mark your matrices as being transposed. Group elements are specified by an optional character string followed by a list of 16 real numbers. For the case of generators, the char- acter string represents the name of that generator. Its main use is with the automatic group software: the name used here should match that of the generator in the word acceptor file. It should, for example, be a single character for the software to work reliably. For composite elements, the string is the word in the generators which describes this group element. OOGL libraries expect discrete group files to use the '.dgp' suffix. A file which describes the group of the three dimensional torus follows: DISCGRP (group 3torus ) (comment " This is a test of the new discrete group library. " ) (attribute Euclidean ) (display centercam ) (enumdepth 3 ) # look at all words of length 3 or less in generators (enumdist 10.0 ) # and which don't move the origin more than 10.0 (dimn 3 ) (ngens 3 ) (gens a 1 0 0 0 0 1 0 0 0 0 1 0 1 0 -0.1 1 b 1 0 0 0 0 1 0 0 0 0 1 0 0.1 1 0 1 c 1 0 0 0 0 1 0 0 0 0 1 0 0 0.2 1 1 ) (cpoint 0.000000 0.000000 0.000000 1.000000 ) (camgeom { = OFF 5 2 5 0 0 0 -0.1 0 0.5 0.1 0 0.5 0 -0.1 0.5 0 0.1 0.5 3 0 1 2 200 200 0 .8 3 0 3 4 0 200 200 .8 } ) FILES
Example group files are to be found in the OOGL release in ${GEOM}/data/groups, where e.g., GEOM = /u/gcg/ngrap. See also discgrp(3) and automata(1). AUTHORS
Charlie Gunn. BUGS
For dimension 2, the code should read and write 3 x 3 matrices. Date: 92/08/26 discgrp(5gv)
All times are GMT -4. The time now is 08:05 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy