Sponsored Content
Full Discussion: Remove space with sed
Top Forums UNIX for Beginners Questions & Answers Remove space with sed Post 303037248 by Neo on Saturday 27th of July 2019 07:59:07 AM
Old 07-27-2019
Hello arm!

In case you forgot to read the forum rules, here are two rules you are not following here:



Quote:
RULES OF THE UNIX AND LINUX FORUMS


(5) Search the forums database with your keywords before asking questions.

(8) Use Code Tags around all code and data fragments in posts.
Please follow posting rules.

Thanks

Neo
This User Gave Thanks to Neo For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

to remove space after numeric

I have a script that shows me the disk SPace used by different dir under my home dir: #!/bin/ksh cd /ednpdtu3/u01/pipe p1=`df -g | tail -1 | tr -s " " | cut -d " " -f2` echo "Total Disk Space of Home Dir is $p1 GB" p2=`df -g | tail -1 | tr -s " " | cut -d " " -f3` echo "Total Disk Space... (2 Replies)
Discussion started by: ali560045
2 Replies

2. Shell Programming and Scripting

How to remove space in sed for / character

Hi... i need a script to remove the space before and after the operator like( / ). Ex : Input file apple / manago mango / fresh apple / fresh Desired output: apple/manago mango/fresh apple/fresh Note: betwee the desired operator space should be removed, between words do not remove... (3 Replies)
Discussion started by: vasanth_vadalur
3 Replies

3. UNIX for Dummies Questions & Answers

Space in file how to remove

Hello I have a file with data something like this in it : texttexttext "text .lst" TEXT=" text " texttexttext "moretext .lst" TEXT=" text " Question is how do I get rid of space so that the files looks like this : texttexttext "text.lst" TEXT="text" texttexttext... (8 Replies)
Discussion started by: davebw
8 Replies

4. Shell Programming and Scripting

Remove space

DATE=6/Jul/2010 6/Jul/2010 var="sed -n '/\ ---------- Post updated at 11:49 AM ---------- Previous update was at 11:36 AM ---------- #!/bin/bash DATE=`./get_date.pl 3` DATE1=`./get_date.pl 2` var1=$( echo "$DATE" | sed "s/ //g" ) var2=$( echo "$DATE1" | sed "s/ //g" ) var="sed -n... (1 Reply)
Discussion started by: sandy1028
1 Replies

5. Shell Programming and Scripting

Remove space before a character

Hi guys, I am new to shell scripting and I have a small problem...If someone can solve this..that would be great I am trying to form a XML by reading a flat file using shell scripting This is my shell script LINE_FILE1=`cat FLEX_FILE1.TXT | head -1 | tail -1` echo... (1 Reply)
Discussion started by: gowrishankar05
1 Replies

6. Shell Programming and Scripting

How to remove tab space and new line from a file using sed?

i am using the default sed package that comes with solaris. (11 Replies)
Discussion started by: chidori
11 Replies

7. Shell Programming and Scripting

remove space

File A.txt A005 -119.5 -119.5 -100.5 A006 -120.5 -119.5 -119.3 A008 0 0 0 Output A005 -119.5 -119.5 -100.5 A006 -120.5 ... (1 Reply)
Discussion started by: asavaliya
1 Replies

8. UNIX for Advanced & Expert Users

Need to remove leading space from awk statement space from calculation

I created a awk state to calculate the number of success however when the query runs it has a leading zero. Any ideas on how to remove the leading zero from the calculation? Here is my query: cat myfile.log | grep | awk '{print $2,$3,$7,$11,$15,$19,$23,$27,$31,$35($19/$15*100)}' 02:00:00... (1 Reply)
Discussion started by: bizomb
1 Replies

9. Shell Programming and Scripting

sed - remove space and . for a pattern

Hi, I have file which contains following lines A| 965.|Mr.|35.45| 66. B| 33.| a456.| 77. The output should be A|965|Mr.|35.45|66 B|33| a456.|77 Basically if a Number has space in prefix and . in suffix remove both. So pattern could be if there is a | which has next two characters as... (1 Reply)
Discussion started by: wahi80
1 Replies

10. Shell Programming and Scripting

Remove space from numeric value

Hello, I need help. I have xml file and there are one extra space on number <EpiReference>1 42345</EpiReference>. And of cource, the value change on every new file. I need remove space from that value what is in between <EpiReference> and </EpiReference>. How I can do that? This are example... (9 Replies)
Discussion started by: Jopsulainen
9 Replies
DEVFS.RULES(5)						      BSD File Formats Manual						    DEVFS.RULES(5)

NAME
devfs.rules -- devfs configuration information DESCRIPTION
The devfs.rules file provides an easy way to create and apply devfs(8) rules, even for devices that are not available at boot. For devices available at boot, see devfs.conf(5). The format of this file is simple. Empty lines and lines beginning with a hash sign ('#') are ignored. A line between brackets denotes the start of a ruleset. In the brackets should be the name of the ruleset and its number, separated by an equal sign. Other lines are rule specifications as documented in devfs(8), in the section Rule Specification. These lines are prepended with ``rule'' and are passed to devfs(8) by the startup scripts of the system. It is important to put path elements that contain glob(3) special charac- ters between quotes. Rulesets should have a unique name and number. All rules that follow a ruleset declaration belong to that ruleset, until a new ruleset is started. One custom ruleset has to be enabled in /etc/rc.conf, otherwise it will not be applied to the /dev file system by the default system startup process. For example, to enable a ``localrules'' ruleset for the /dev file system, you would have to use something like this in your rc.conf file: devfs_system_ruleset="localrules" FILES
/etc/defaults/devfs.rules Default devfs.rules configuration file. /etc/devfs.rules Local devfs.rules configuration file. Rulesets in here override those in /etc/defaults/devfs.rules with the same ruleset number, otherwise the two files are effectively merged. EXAMPLES
To make all the partitions of da(4) devices readable and writable by their owner and the ``usb'' group, the following rule may be used: [localrules=10] add path 'da*s*' mode 0660 group usb The first line declares and starts a new ruleset, with the name localrules and the number 10. To give usbconfig(8) and libusb(3) enabled applications permission to all usb devices for their owner and the ``usb'' group, a similar rule may be used: add path 'usb/*' mode 0660 group usb SEE ALSO
glob(3), devfs(5), devfs.conf(5), devfs(8) AUTHORS
This manual page was written by Roland Smith <rsmith@xs4all.nl>. BSD
February 21, 2010 BSD
All times are GMT -4. The time now is 02:10 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy