Red Hat / Fedora :: Edit A Text File To Delete All Commas In The File?
Jan 4, 2011i want to find a command line way to edit a text file to delete all commas in the file. i do not want to replace them w/ anything.
View 2 Repliesi want to find a command line way to edit a text file to delete all commas in the file. i do not want to replace them w/ anything.
View 2 RepliesUsing sed, I am trying to append four commas ',,,,' at the end of lines containing the pattern 'Response' in a text file with lines such as these:
6,Pulse,50,254968,14886,NA,,,,
7,Picture,8,265157,0,1,15045,2,0,15000
7,Response,1,271553,6396,1
7,Pulse,50,274969,9812,NA,,,,
8,Picture,1,290232,0,1,15045,2,0,15000
8,Pulse,50,294969,4737,NA,,,,
[Code].....
can i actually edit /etc/sysconfig/iptables and create/delete rules inside that file?will it work? i just find using the IPTABLES -A or -D command a hassle
View 3 Replies View RelatedI have to delete a certain line of text from the a textfile via ubuntu's shell scripting.I have done research, and it seems that most people advocate the usage of sed /d option. sed makes does not edit the text file. Hence, most options I discovered involved the use of a temporary variable/textfile and then overwriting the old file with the temporary new file. Is there anyway whereby I can bypass the use of temporary storage containers? I hope there is any magical combination of commands to edit the file directly.
View 3 Replies View RelatedI have a linux.img image for ubuntu.I want to edit file inside it, how can open it, edit a file, then remake the bin file?
View 7 Replies View RelatedI'm having a problem where I'm unable to delete a file, even as root. Any attempts to remove or otherwise modify the file result in 'Operation not permitted'.
# rm d91c6a6e_2a2d7_out.xml
rm: remove regular file `d91c6a6e_2a2d7_out.xml'? y
rm: cannot remove `d91c6a6e_2a2d7_out.xml': Operation not permitted
I just modified the grub file in 10.10 in order to see what the text line boot is like. Well now I want to go back, but when I try to gedit /etc/default/grub it gives an error that he couldn't display. How can I edit the file to go back to gnome??? I am on macbookpro 6.2 tripleboot Mac OS 10.6, Win7 and Ubuntu 10.10.
I dont have permisions to edit plain text file.
When I run:
Through various Windows reinstalls and switches within Linux distros, I have a massive amount of duplication within my music archive (on the order of 7+ dupes of each file). Now, I found a lovely program called "fdupes" and was able to build a list of all the duplicate files, and I'm trying to use "xargs" to remove then. However, when I try and run the command "xargs -0 --arg-file="dupes.txt" rm" or "xargs -0 rm < "dupes.txt"" it give me the following error: "xargs: argument line too long".
how perhaps a different way of accomplishing the same thing?
I need to chop of the top 30ish lines of several log files until a line starting with "Initialization completed."The trouble is that it's not always the same amount of lines that need to be deleted, and they don't always contain the same information, which is why I would need to delete everything priorhe line starting with "Initialization completed."Right now I have a little script I wrote based on looping each file through several "grep -v" commands with each known pattern of lines I want to ignore, but it is tedious and I have to inspect each file afterwards to make sure nothing is left from above "Initialization completed
View 3 Replies View RelatedThere are weird commas after the real-name parameter of some lines in my /etc/password file.
kye:x:1000:100:Kye,,,:/home/kye:/bin/bash
What gives? Why are they there? Can I remove them?
I am using Ubuntu and looking for a good editor to edit a file that is > 4GB. I just need to put content at the end and beginning of the file. I suppose I could use something like
cat "text to add" >> huge_file
To append to the file. Is that the route to go? What about prepending? In general, what is the best route if I wanted to edit somewhere in the middle?
I've tried VIM and it fails miserably. I assume emacs and nano would be even worse. What else is there? I assume to accomplish what I am looking for, the editor would have to be specifically designed for this by not keeping the entirety of the file's contents in memory.
I have installed KDE 4.6.1, on distribution Ubuntu 10.10 . But i have problem with trash icon. Even when i delete a simple text file, trash icon not change, shows empty icon. When I open trash directory location from dolphin, left side shortcuts, it shows empty directory.Is it a bug? Where is my deleted file gone?
View 4 Replies View Relatedim trying to output a list of running processes via a shell script. At the moment i got this which outputs the processes to a text file called out.
echo $(ps aux) >>out
The problem is though, the processes are all just one big block of text which makes it hard to read. Does anyone know how to sort the output to a text file so that it prints to the text file at 1 process per line? I know its probably simple but im very new to linux.
I am looking for some source package which will convert plain text file to html file without using perl.
I mainly need to do this on an ARM platform, so if I get sources I can cross compile it.
I have a text file called file1.txt containing many lines eg.
line1
line2
line3
line4
line5
line6
Then i have another text file called file2.txt contains
3
5
6
Is there a command to remove the lines in file1.txt based on the keywords in file2.txt? note: It should remove line3,line5,line6 based on 3,5,6
I put a text file on my desktop and added a couple lines of text with gedit. File type shows text/plain. Double-click opens the file in gedit which is what I want. I'm using the file to temporarily hold some snips of code that I copy from file to file, but when I copy some html into the file and save it, now file properties show it's text/html and a double-click opens the file in firefox, which isn't what I want. Is there some way to keep the file type from changing itself?
View 6 Replies View RelatedWas wondering if any perl guru's could help me with a quick log file adjustment. I have a text file that looks like so (tabs and newlines are revealed so you can see what separates the data):
There are maybe 100 lines of text in this file at any given time. I need to delete all duplicate lines only looking at the first bit of text prior to the first tab. It doesn't matter which one gets deleted as long as there are no two lines that begin with that same text at the beginning before the first tab. So in this example, either the fist line "1234" or the last line "1234" would need to be deleted. I already have code in my script that opens the files - I just need the code to read the text into an array and the part that would find matches based on the above criteria, and make the deletions.
If it would be easier, I can even do a system call and use SED (v4.1.5) and/or AWK (3.1.5) instead.
When i open any .pps file with OO.org (impress), it starts a slideshow and it doesn't let me edit the file. If i click on "end slideshow", the program exits.i ran it in a terminal and there's no error messages.[EDITED]Well, i found the answer, just renaming it to ".ppt".
View 2 Replies View RelatedHow could I replace text in one file with text from another file using sed?
The text in each of the files would be surrounded by a starting and ending delimiter or a starting tag, say like /* */ so to easily find them.
How to edit a ISO 9660 file? I have one which I created using livecd-creator. Now I want to edit some of the files in it and save the changes. I have searched the guides and solutions for something and perhaps I overlooked it but I did not find anything.
View 5 Replies View RelatedI want to know how to edit a simple text file of 5 pages without open it on cui or gui. i want to replace some of its content like name and value with other for further use.
View 1 Replies View RelatedMany folders within a subdirectory some of which have lots of data in and some of which have only one specific file called produkt.fil inside.I need a command to find and delete those folders that contain ONLY the file produkt.fil - if other files exist (doesnt matter what they are) then they should be left alone. Note: produkt.fil exists in all of the folders always.
View 5 Replies View RelatedWhen I ls -l /etc/passwd, -rw-r--r-- 1 root root /etc/passwd When I login as myself, and rm /etc/passwd, it asks: rm: remove write-protected file '/etc/passwd'? If I say yes, will it actually delete the passwd file?
View 1 Replies View RelatedI'm trying to view the /etc/termcap file, but it doesn't seem to exist. Am I missing something on my install? I used the Fedora Core 14 live CD to install it to my hard disk for a dual boot configuration with Win 7.
View 2 Replies View RelatedI am trying to delete lines of a file if they contain text that is present on another file. For example
> cat one.txt:
a
b
c
d
[code]....
I get the following output:
> ./test.sh one.txt two.txt
a
b
d
e
[code]....
So a few minutes ago, i was messing around with the system, installing some programs, doing updates, etc... Did a reboot because i was messing around with stuff and just wanted to see something, and when i logged back in, the file/edit toolbar doesnt show in any program EXCEPT for firefox. What the hell could this be? I tried everything already.
fedora 11 - 2.6.30.9-96, using gnome
My sample rates are out of whack and I need to edit the daemon.conf file.
However if I use
Code:
It will open the file but will not let me edit at all. If I just navigate to it I can edit it, but I can not save it!
I tried going in as root from the terminal and using the code above and I get a weird error.
Something like:
Then it says core dump.
Am I missing something to be able to edit the daemon.conf ?
edit the sudo config file to allow my account to use some commands as a root.so can someone advise me how should i do it.
View 3 Replies View RelatedI got a diferent domain. I got a modem-router (192.168.1.254 ) thats connect my computer with apache (192.168.1.68) I got dinamic dns with inadyn to update the ip adress for my domains. My question how to edit the hostname file (/etc/hosts)?
[Code].....