Sponsored Content
Top Forums Shell Programming and Scripting Remove blank spaces in a text file... Post 302281803 by vgersh99 on Thursday 29th of January 2009 12:58:44 PM
Old 01-29-2009
Code:
{rm tfile; sed '/^[ ]*$/d' > tfile; } < tfile
OR
printf '/^[ ]*$/d\n.\nwq' | ex -q tfile

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

To remove Continous blank spaces from a file in UNIX

All... I want to remove blank spaces in file . I just leraned that we can use " cat <Input filename> | tr -s ‘ ‘ > <Target file name> " i also know with SED we can replace a blank space by other character by sed s/ /*/g filename. Please let me know how can i do that by... (1 Reply)
Discussion started by: arunkumar_mca
1 Replies

2. Shell Programming and Scripting

how to remove blank spaces of a file with awk??

hello how to remove blank spaces of a file with awk?? i´m trying awk '{gsub(" ","",$0); print $0;}' filename.txt but it answers syntax error near line first of all i did this for download from netbackup database jobs privilege bpdbjobs -report -M sv88 -gdm -header |cut -c-1024... (4 Replies)
Discussion started by: pabloli150
4 Replies

3. Shell Programming and Scripting

remove blank spaces from fields

Hi Friends, I have large volume of data file as shown below. Beganing or end of each filed, there are some blank spaces. How do I remove those spaces? AAA AAA1 | BBB BB1 BB2 |CC CCCC DDDD DD | EEEEEEE EEEEEEEE | FFF FFFFFF FFFF GG GGGGGG |HH HH ... (3 Replies)
Discussion started by: ppat7046
3 Replies

4. Shell Programming and Scripting

Replace blank spaces with semicolon - text file

Hi all, Been trying to find a solution to this, I'm sure its a sed 1 liner, but I don't know sed well enough to work it out... I have a text file in the following format: 431 666 1332 2665 0.24395 432 670 ... (3 Replies)
Discussion started by: mpcengineering
3 Replies

5. UNIX for Dummies Questions & Answers

Remove blank lines and comments from text file

Hi, I am using BASH. How can I remove any lines in a text file that are either blank or begin with a # (ie. comments)? Thanks in advance. Mike (3 Replies)
Discussion started by: msb65
3 Replies

6. Shell Programming and Scripting

how to remove blank spaces in file

hi i have a file which store some data.the contents of my file is data1:data2 data3:data4 i have a script which read this file correct="$(cat /root/sh | cut -d: -f1)" i used this syntax..please help me which syntax is used to remove blank spaces..then how to read this file.. (1 Reply)
Discussion started by: shubhig15
1 Replies

7. Shell Programming and Scripting

How to remove blank line from a text file?

Hi All, I am creating a text file using perl. The first record I am writing as "$line" and all the other as "\n$line". At the end the file is having N number of lines. I am using this file for MLOAD (Teradata), which is reading N+1 lines in the file and failing.I am not able to find new line... (2 Replies)
Discussion started by: unankix
2 Replies

8. Shell Programming and Scripting

How to remove all blank spaces in a file

I have a file which contains data such as that shown below. How do i remove all the blcnak spaces, before, during and at the end of each line in one command? 300015, 58.0823212, 230.424728 300016, 58.2276459, 229.141602 300017, 58.7590027, 226.960846 ... (9 Replies)
Discussion started by: carlr
9 Replies

9. Shell Programming and Scripting

Remove blank spaces

Gents, Please can you help me.. to remove blank spaces :) Input ABSOLUTE , ,FALSE ,1035 ,28 ,669 ,1817.0 ,CORREL BEFORE ,1 ABSOLUTE , ,FALSE ,1035 ,28 ,686 ,1817.0 ,CORREL BEFORE ,1 ABSOLUTE , ,FALSE ,1035 ,28 ,670 ,1819.0 ,CORREL BEFORE ,1 ABSOLUTE , ,FALSE ... (4 Replies)
Discussion started by: jiam912
4 Replies

10. UNIX for Dummies Questions & Answers

Remove blank spaces

Dear Masters, I want to remove all lines with blank spaces input file: a|abc|0|1 a|abc|2|3 b||3|5 c|def||7 d|def|0|1 Expected: a|abc|0|1 a|abc|2|3 d|def|0|1 I did this awk -F'|' '!/^$/' input (4 Replies)
Discussion started by: radius
4 Replies
amk_ccc(1)						       Scotch user's manual							amk_ccc(1)

NAME
amk_ccc, amk_fft2, amk_hy, amk_m2, amk_p2 - create target architectures SYNOPSIS
amk_ccc [options] dim [tfile] amk_fft2 [options] dim [tfile] amk_hy [options] dim [tfile] amk_m2 [options] dimX [dimY] [tfile] amk_p2 [options] [wght0] [wght1] [tfile] DESCRIPTION
The amk_* programs create target architecture files for some common, regular topologies. amk_ccc creates a decomposition-defined cube-connected-cycle topology of dimension dim. The decomposition is performed first by bisection along the dimensions of the hypercube, then along the remaining cycle graphs. amk_fft2 creates a decomposition-defined fast-Fourier-transform topology of dimension dim. The decomposition is performed by recursive bisection of the vertices, by descending dimension (that is, bit number in the labeling of the vertices). amk_hy creates a decomposition-defined hypercube topology of dimension dim. The decomposition is performed by recursive bisection of the vertices, by descending dimension (that is, bit number in the labeling of the vertices). Save for experimentation purposes, this program is deprecated, as the algorithmically-defined 'hcub' target architecture is a more convenient and efficient way to represent hypercube archi- tectures. amk_m2 creates a decomposition-defined 2D regular grid topology of dimensions dimX and dimY. The decomposition is performed by recursive splitting along the dimensions, either by cutting the longest one, or by one-way dissection, depending on the '-m' option flag. Save for experimentation purposes, this program is deprecated, as the algorithmically-defined 'mesh2D' and 'mesh3D' target architectures are a more convenient and efficient way to represent 2D and 3D grid architectures. amk_p2 creates a weighted path graph topology comprising only two vertices of weights wght0 and wght1. This is just a helper program, which builds a 'wcmplt' algorithmically-defined complete graph with two vertices. It may be used to compute weighted bisections of a graph. When the proper libraries have been included at compile time, the amk_* programs can directly handle compressed files, both as input and output. A stream is treated as compressed whenever its name is postfixed with a compressed file extension, such as in 'brol.tgt.bz2' or '-.gz'. The compression formats which can be supported are the bzip2 format ('.bz2'), the gzip format ('.gz'), and the lzma format ('.lzma', on input only). OPTIONS
-mmeth For amk_m2 only. Perform either recursive dissection or one-way dissection, according to the given method flag: n perform nested dissection (default). o perform one-way dissection (cut across Y, then X). -h Display some help. -V Display program version and copyright. EXAMPLE
Create a cube-connected-cycle target architecture of dimension 4, and save it to file 'ccc4.tgt'. $ amk_ccc 4 ccc4.tgt Run gmap to compute a bisection, into two parts of respective weights 3 and 5, of graph 'brol.grf' and save the resulting mapping to file 'brol.map'. The dash '-' standard file name is used so that the target architecture description is read from the standard input, through the pipe. $ amk_p2 3 5 | gmap brol.grf - brol.map SEE ALSO
acpl(1), atst(1), amk_grf(1), dgmap(1), gmap(1). Scotch user's manual. AUTHOR
Francois Pellegrini <francois.pellegrini@labri.fr> February 14, 2011 amk_ccc(1)
All times are GMT -4. The time now is 01:12 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy