Sponsored Content
Top Forums Shell Programming and Scripting Replace multiple dots (.) with spaces ( ) Post 302312725 by devtakh on Sunday 3rd of May 2009 03:02:52 AM
Old 05-03-2009
No worries. you can do either way. If you want to put it in shell script, then make sure that the file is in the same directory as the script .

It will be easier if you run it from the command prompt. just replace the filename with your file and then redirect the o/p to another file.

Code:
tr '.' ' ' < filename | sed 's/\(.*\) \([^ ]*[aA-zZ][aA-zZ]*$\)/\1.\2/g' > outfile


cheers,
Devaraj Takhellambam
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Replace spaces recursively

Hi, I have a directory with files and sub-directories (sub-directory depth might go upto 5). There will be one or more spaces (continuously or anywhere in the file name) which need to be replaced with HYPHENs. How can i replace all SPACE occurances with HYPHEN in file/dir names recursively. (2... (5 Replies)
Discussion started by: prvnrk
5 Replies

2. Shell Programming and Scripting

Stripping out extensions when file has multiple dots in name

I posted this already in another thread, but was told that I should create a seperate thread for the following question: How do I strip the extension when the delimiter might occur multiple times in the filename? For example: I have 2 files as input for my script. test.extension... (8 Replies)
Discussion started by: Nemelis
8 Replies

3. Shell Programming and Scripting

Replace spaces

Hi guys, so I have another issue. Can I use sed to replace spaces in a string or variable with %20 I am having trouble with using curl on URL's containing spaces Thanks! (12 Replies)
Discussion started by: tret
12 Replies

4. Shell Programming and Scripting

replace 2 spaces by one

Dear Friends, I have a flat file from which I want to remove single "space". And, wherever two spaces are provided it should replace it by only one space. E.g. I have N A T I O N A L E D U C A T I O N F O R O R G AN I S A T I ON S I want NATIONAL EDUCATION FOR ORGANISATIONS Please... (5 Replies)
Discussion started by: anushree.a
5 Replies

5. UNIX for Dummies Questions & Answers

how to replace spaces with '_' in a file?

Hello #I have a file with a list of sequences; the sequence name is the line starting with '>'. $cat infile >AluYa5 SINE1/7SL Homo sapiens ggccgggcgcggtggctcacgcctgtaatcccagcactttgggaggccgaggcgggcggatcacgaggtc aggagatcgagaccatcccggctaaaacggtgaaaccccgtctctactaaaaatacaaaaaattagccgg... (11 Replies)
Discussion started by: jdhahbi
11 Replies

6. Shell Programming and Scripting

Replace with spaces

Hi Guys file:///C:/DOCUME%7E1/c104058/LOCALS%7E1/Temp/moz-screenshot.pngsed 's///g' /source/filename.txt > /destination/filename.txt The above code deletes the characters which are not A-Z, a-z and 0-9, but I wanted to replace it with space without deleting them. Any help is... (2 Replies)
Discussion started by: gowrishankar05
2 Replies

7. Shell Programming and Scripting

Remove filenames beginning with multiple dots

hi all, I want to remove filenames beginning with multiple dots.how I can do this. Thanks in advance (5 Replies)
Discussion started by: sriharsharavi
5 Replies

8. Shell Programming and Scripting

Get file extension with multiple dots

I am trying to get the file extension with file names that could contain multiple dots using shell scripting. I want to find a way using the sed command. Example Filenames: one.dat one.dat.002 Results: dat I would like to return dat in both instances using the sed command. How can I... (4 Replies)
Discussion started by: smkremer
4 Replies

9. Shell Programming and Scripting

Replace white spaces of multiple files at once

How to rename multiple files by replacing the white spaces with underscore for ex: 293TrexFH\ \ \ GSM855007RINGB_lhb11_binary.txt 293TrexFH\ \ \ GSM855007RINGB_lhb12_binary.txt 293TrexFH\ \ \ GSM855007RINGB_lhb13_binary.txt 293TrexFH_GSM855007RINGB_lhb11_binary.txt... (1 Reply)
Discussion started by: quincyjones
1 Replies

10. Shell Programming and Scripting

awk gsub command to replace multiple spaces

Hi Forum. I'm trying to cleanup the following data elements (To remove any occurences of commas and any extra spaces) while preserving the <TAB> delimiter using awk gsub but I have not been successful. Original Data: 4365 monte des source rue,, ,<TAB>trevost<TAB>QC Desired Data:... (1 Reply)
Discussion started by: pchang
1 Replies
TEK4957(4x)															       TEK4957(4x)

NAME
tek4957 - Tektronix 4957 input driver SYNOPSIS
Section "InputDevice" Identifier "idevname" Driver "tek4957" Option "Device" "devpath" ... EndSection DESCRIPTION
tek4957 is an XFree86 input driver for the Tektronix 4957 tablet. The tek4957 driver functions as a pointer input device, and may be used as the X server's core pointer. CONFIGURATION DETAILS
Please refer to XF86Config(5x) for general configuration details and for options that can be used with all input drivers. This section only covers configuration details specific to this driver. Option "Device" "devpath" sets the path to the special file which represents serial line where the tablet is plugged, for example /dev/ttyS0. This option is mandatory. Option "DeviceName" "name" sets the name of the X device. Option "Speed" "number" sets the sampling rate, from 1 to 6. Default is 6, maximum speed. Option "Resolution" "number" sets the resolution. 0 : 2340 dots : 1/200 inch 1 : 2972 dots : 1/10 mm 2 : 11700 dots : 1/1000 inch 3 : 11887 dots : 1/40 mm 4 : 5850 dots : 1/500 inch 5 : 5944 dots : 1/20 mm : default 6 : 4680 dots : 1/400 inch 7 : 1170 dots : 1/100 inch 8 : 12 dots : 1 inch 9 : 24 dots : 1/2 inch Option "TopX" "number" X coordinate of the top corner of the active zone. ( Default = 0 ) Option "TopY" "number" Y coordinate of the top corner of the active zone. ( Default = 0 ) Option "BottomX" "Inumber" X coordinate of the bottom corner of the active zone. ( Default = full scale ) Option "BottomY" "number" Y coordinate of the bottom corner of the active zone. ( Default = full scale ) BUGS
/ LIMITATIONS Currently, only "Absolute" mode is supported ( Sorry ) SEE ALSO
XFree86(1), XF86Config(5x), xf86config(1), Xserver(1), X(7x). AUTHORS
Olivier DANET <odanet@caramail.com> XFree86 Version Version 4.3.0 TEK4957(4x)
All times are GMT -4. The time now is 04:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy