Ubuntu :: Remove All Double Or More Spaces From A Group Of Words?
Mar 7, 2010How could someone remove all double or more spaces from a group of words? Is there a GUI program or CLI method or both? Example: I like to turn this:
[Code]...
How could someone remove all double or more spaces from a group of words? Is there a GUI program or CLI method or both? Example: I like to turn this:
[Code]...
I tried Suse five or six years ago and ran into an issue that was not comfortable to work with so I went back to windows. The problem was open spaces between words was not permitted with my music files. I have transferred all of my CDs and LPs to MP3 and have a tremendous number of them and the Suse of five years ago required I convert a title like Foggy Mountain Special.mp3 into something resembling Foggy_Mountain_Special.mp3
I don't care to convert literally a hundred thousand titles to fit the latter format. Does the current version of Suse allow the use of spaces between the words or is the 'no open space' convention still required?
I have just switched to banshee as my media player and imported my films and music. Problem is, the video list is quite hard to read because all the video files have spaces in their names which are replaced by % signs, numbers and letters. I'm wondering if there is a command I can use in the directory that will automatically remove all the spaces from the filenames or better still, replace the spaces with hyphens or underscores?
View 6 Replies View Relatedi want to remove words "Max" and "constrained" in a file given below:
Max 0.003745 constrained
Max 0.004549 constrained
Max 0.001689 constrained
[code]....
and further want to replace "Max" by line number so that i can plot the resulting file. i searched in forum, but couldn't do what i wanted to do. e.g. i used
1)grep command
grep -v "Max" inputfile >outputfile
deletes whole line,and hence whole text.
2) sed command
cat inputfile |sed 's/ .{1,12} //g' >outputfile
gives output
0.003745constrained
0.004549constrained
0.001689constrained
[code]....
I have a folder with many many files. e.g html, docs, excel sheet, script etc.
Now I want to find {using grep command}a certain word in that folder/directory and delete it in all the files and scripts that have it.
For example, I want to delete the word /testing (with the slash) in all files in a directory.
I am reading the output of /proc/acpi/thermal_zone/ATF0/temperature in a program to read my CPU temp. I am using cat like the following:
Code:
#cat /proc/acpi/thermal_zone/ATF0/temperature
temperature: 49 C
I basically want to get rid of the spaces in between temperature and the actual temperature. Is there a command I can pipe the cat output to, to remove the spaces. I have seen suggestions for sed, or tr, but for some reason I cannot get them to work properly.
the preceding and trailing spaces around the commas in my CSV without destroying my address field. I'm new to regex and sed so this is probably easy but I just can't do it without destroying the Address section. I'm using vanilla Linux and sed 4.1.3I'm willing to use any regex or even awk if needed.
Example:
I need this
randall , dean, 11111 , 1309 Hillside Ave., Warsaw, VA , 23591
[code]....
How to remove all foldernames which contains spaces in Desktop with a single command?
View 7 Replies View RelatedI am basically trying to remove duplicate words in my <title></title> tag after I got hit by Google Panda. I have around 750 .html files and it will be difficult for to me remove one by one. I am looking for a way to remove only from within <title> </title>
Example of a duplicate title I have:
Code:
<title>Pasta, Pasta Recipe and Pasta Guide</title>
I dont want to replace those words anywhere else in the file except for within the <title>
I'm hoping that someone can help me, I need to remove spaces (not replace with underscores) from several thousand files on a system with cygwin.
Can I do this from the shell using rename or mv somehow?
need all spaces between two letters or a letter and a number exchanged for an underscore, but all spaces between a letter and other characters need to remain. One example for clarity:
Input:
force -- lamin 90 [label]
active A -- generation [label]
needed Output:
force -- lamin_90 [label]
active_A -- generation [label]
I tried solving this with sed but obviously s/ /_/g does not work, nor does any s/[a-zA-z0-9] [a-zA-z0-9]/[a-zA-z0-9]_[a-zA-z0-9]/g , because you just can't do this...
Im using this unix command(in a php file) to remove a certain string and then remove the whitespace left by that string. Unofrtunately in many cases, the files get completely erased. Is there a workaround?
Code
<?php
$dir = "./";
$rmcode = `find $dir -name "*.php"
[cod3e]....
I am currently using Windows Vista and Linux Ubuntu (I'm not 100% sure which version).However, whenever I start up my PC, I get greeted to the HP BIOS screen, and then after that, I get the Windows Bootloader.Now, this is where things get interesting:If, on the Windows Bootloader I select Microsoft Windows Vista, it loads Vista.If I select Ubuntu on the Windows Bootloader, I get treated to a second bootloader (I assume the Ubuntu Bootloader).I'm wanting to remove one of the bootloaders (keeping Vista as my primary OS, but still having access to Ubuntu in the bootloader). As a result of this, which bootloader should I remove, and how would I go about removing such bootloader?
View 2 Replies View Relatedgrep -e XkbLayout /etc/X11/xorg.conf | grep -v "^#" | awk '{print $3}'
output = "gb"
sometimes= "us"
how do I remove a double file like " New File" look through everything I own no explantion.
View 3 Replies View RelatedIs it possible, in Linux, to rename a file from something without spaces to something containing spaces? I know I can create directories and files with spaces by doing:
mkdir "new dir" and:
touch "new file.txt"
I want to rename files from:
imgp0882.jpg to something like:
20091231 1243 some topic.jpg
And how would it look in a shell script that uses parameters like:
for i in *.jpg do
rename "$i" "$somepath/$mydate $mytime $mytopic$extension"
?
I'm new to Linux (using PCLinuxOS 2009.2), coming from Windows, and I've written myself a little shell script to download files from my camera and then automatically rename them according to a date-and-topic pattern. As you can guess by now, I'm stuck on the bit about renaming. If you want to see my script, here's a copy. I'm not using jhead for this renaming because that only works with JPEG files but I want a single solution for any media format including videos.
How would i write a command that can find all the objects under the etc directory that have group write permission enabled and have not been accessed in the last X days. This is what i got from internet souce but i m not able to modify it according to my distribution. find /etc -perm -0070 -a -mtime +X ! -type l?print Here is the exact statement from link i m referring to.
[Code]..
I'm trying to do a disk upgrade on some servers. They are using LVM with DRBD on top and each LVM volume contains a Xen image. I have already created identical volumes on another volume group, copied the data and pointed DRBD to the new source (Which seems to have worked).
What I am unsure of is how to safely remove the disks. The disks are an Areca Raid 1 array and support hotswap. Can I just pull them out of the machine or is some sort of command needed to tell LVM or the kernel to disconnect from the physical array device? Is removing the raid array from the Areca management GUI first a good idea?
I need to test linux group permissions on a repository. In one shell, how can I temporarily remove one of my group associations? e.g.If my groups are defined as:
% groups
foo bar baz
How can I make it so it only returns foo bar without baz?
How would i remove rwx permission for group and other users for all hidden files (except . and ..) inside /root using a one line command.
View 4 Replies View RelatedMy laptop's been locking up in Linux (Ubuntu, Backtrack, Puppy) periodically for a while now. When it locked up, it was always immune to the magic of SysRq, which I thought might indicate a hardware problem. It became so bad that I had to stop using the laptop.
Today, when I turned it on and tried to boot into Fedora 12, I got the following error (just once, it just locked up at various points during the splash screen after this once):
double fault: 0000 [#1] SMP
last sysfs file:
CPU 0
odules linked in:
Pid: 1, co m: swapper Not ta nted 2.6.32.11-99.fc 2.x86_64 #VGN-T 250N
RIP: 0010:[<ff
All the seemingly missing letters were really missing, not my typos.
As you can see, kernel version is 2.6.32.11-99.fc12.x86_64 and my laptop is a Sony Vaio TZ 250N (Core 2 Duo ULV 1.2GHZ). Note that with the other remaining kernels from the updates, nothing ever happened other than the locking up. The core temperatures hover pretty high, about 55-60C peak but this is still below the critical temp. Memtest came up clean when the problem first started happening.
my error is : the groop was not found..i am trying to install openoffice , but its doing it in any software..
View 9 Replies View RelatedHow can I create a user group that restricts Internet privileges to only members in the group, then I will assigns certain applications to join the group for access to the Internet.
For example, I want only group net to have access to the Internet. Group net is then connected to:
Code:
So far, I am using the gnome group policy manager that is standard with ubuntu but Its not working. It is possible that im misdirected and that I should use a firewall instead?
I have a text file that currently has around 150 000 usernames in it. I need to somehow group them into smaller groups of 1000 and then add that value into the DB. for example user xzy group 1 (hopefully the groups will be digits incrementing)
[Code]....
how to search for 1000 then assign them group 1 and then 1001-1999 to group 2 etc.
i want secondary users can able to change the files permissions of primary group?user MAC is having www as a primary and httpd as secondary group. But he want to change the file permissions (chmod) httpd group files. Is it possible or not? I think its not possible. If it`s possible then let me know how?
View 3 Replies View RelatedI've been tasked with fixing a Red Hat system that dies with a kernel panic during the boot stage:
Code:
EXT3-fserror (dev sda1): ext3_check_descriptors: Inode bitmap for group 4 not in group (block 67239937)!
EXT3-fs: group descriptors corrupted!
mount: error mounting /dev/root on /sysroot as ext3: Invalid argument
I can boot into a Rescue CD, but I'm a bit out of my element because I don't use EXT3 myself, and I've never had to repair a corrupted file system before.
Mount of filesystem failed. A maintenance shell will now be started CONTROL-D will terminate this shell and retry. groups: cannot find name for group ID 0 root@Sergioc-desktop:"#
View 2 Replies View RelatedI have a group (GROUP) with a number of users. I recently added a new user (NEW). NEW is able to read but not write group files, whereas all the other users in the group can read and write to the group files. The permissions for the group files indicate that all members of group should have write permission -rwxrwxr-x
/etc/group indicates that NEW is a member of GROUP
...
GROUP:x:501:GROUP,OLD,OLD2,OLD3,OLD4,....,NEW
[code]....
Don't know if it matters, but both OLD and NEW write to the GROUP files over an internet connection. why NEW can't write to GROUP files? Is there a maximum number of members in a group that I might have exceeded?
In bash I need to use some equivalent of double quotes inside double quotes (or the other way around.)I need to run the following statement to get the output of foo and store it in a variable while passing foo the $file which probably contains spaces.
Code:
variable=$(foo "$file")
The problem is that foo might return an empty string and if it does I need to catch it
[code]...
I need to create a group that has the same permissions as the users group. Can I have the new group be a member of the "users" group to inherit its permissions?
View 4 Replies View Related