General :: Autorefresh The Text File In The Vim?
Jun 15, 2011I use vim to open a text file which is generated by a application. How could I autorefresh the text file in the vim?
View 4 RepliesI use vim to open a text file which is generated by a application. How could I autorefresh the text file in the vim?
View 4 RepliesHow 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.
im 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 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 need to be able to convert HTML email messages saved as text files (.eml or .msg) to PDF documents, one PDF per email, retaining formatting and images.
Are there any Linux tools that will allow me to do this from the command line (so it can be scripted)?
how to verify if the file is binary or text without to open the file
View 2 Replies View RelatedThis is for educational purpose. In fact it is my lab tutorial for a subject.I want to capture the users password when he changes his password. Both new and old.This is the script i have come up with:
Code:
#!/bin/bash
echo "Changing password for user $USER."
[code]...
i'm trying to convert a html file into a text file when i simply run "html2text <filename>" the output displayed is the way we want but when i redirect the same using "-o" or ">>" the file is having extra characters in it. i even tried -ascii,but no much use.
View 4 Replies View Relatedfavor and let me know how can I copy some text in one file and paste it to another file ,when both of the files are being opened by vi text editor ?
View 7 Replies View RelatedI 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 RelatedCan I use sed to include a text file in the beginning of other text files inside a folder and its subfolders? So it should be recursive.
View 4 Replies View RelatedI need to insert 3-4 lines of text to the beginning of a text file. The file is a largish MYSQL dump, the result of a backup shell script. This shell script should insert the required text.I've wrestled with sed, but lost.
View 2 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 want to display something in my text view widget in glade using c code. that's all right.
now I need to attach a save button beneath the text view.so that on click the text view content should save as a txt file..
I want to display the contents of a particular log file (simple text file, I mean in Linux). But there is a problem: The contents need to be organized in a fixed format. Have a look at this log file:
sampleLog.txt
Code:
User Name: XYZ
Reported Problems Description: Blah! Blah! Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah!
[code]....
So, while displaying the contents of above file on a web page, I want to format the field names found in the log file: User Name:, Reported Problems Description:, and Remarks:. These fields may contain a variable length of text and no specific line number is assumed for them to appear on.
The desired output should look like this:
User Name: XYZ
Reported Problems Description: Blah! Blah! Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah! Blah!Blah!
[code]....
Well, what I am trying to do may sound wierd to some of you. The filed "Reported Problems Description:" can possible contain text which embeds colon (.
I am looking for a way to keep a log and make if then statements if a line exitsts in the log. I also am looking for a way to make a simple loop, like goto line number, and I also am wondering how to add/remove bits of text from a text file (plugins line in server.properties)
View 5 Replies View Relateda sed command to add a text before line number in text file? I have text file with 500 lines, and i want to add 3 more lines with text after line 300, OR before line 302, isn't no problem.
View 16 Replies View Relatedhow to replace following text in the file name.cfg ?I need to replace
name:=inet.hr=>1|inet.hr=>1
with
name:=none
I am using
sed -i 's/name:=inet.hr=>1|inet.hr=>1/name:=none/g' name.cfg
I have a text file which is a list of all my contacts. So far i have only found software and commands which remove duplicates but i would like to remove all duplicates AND their original entries too so only contacts which have no duplicates are left.
View 10 Replies View RelatedI ftped a text file from Linux to Windows. I changed the mode to ASCII but it still transferred in BINARY mode. Why? Thanks.
ftp> ascii
---> TYPE A
200 Switching to ASCII mode.
[code]...
in directory so many files are there. if we want to find some text in all the files, what is command is to be used.
View 6 Replies View RelatedWe are currently transferring data from a proprietary DB to Postgresql. All of the data is in text files, each approx 125,000 lines long.I have a problem with 2 of the files.One of the columns contains a numeric which should be in the format 00000.00 or be 0.00 -unfortunately approx 25% of the records contain a null.I can use cut to 'slice' the file into 3 sections but my problem is : how do I keep the values and only replace the nulls with 0.00
View 11 Replies View RelatedI am using Grass GIS
I have written a script which outputs a list of numbers to a file
code snippet:
r.stats -1 fs=, input=Bones_AVE > /home/gary/AVE_monte_carlo/rstats_AVE$i.csv
so this makes acsv file with one column. I want to run it again but rather than outputing to a new csv i want to add it to this one as the next column. For this example there will be 100 rows per column.
the 1st one will make the file
[grassGIS code]> /home/gary/AVE_monte_carlo/rstats_AVE.csv
add ',' after each value
the next one
[grassGIS code] open file /home/gary/AVE_monte_carlo/rstats_AVE.csv
[Code]....
I open a file in Ubuntu nano editor from the comand line and I want to copy all the contents of the file so I can paste it in an another application outside the shell. So far I can only copy using shift on the screen that is visible but not on all content.
View 4 Replies View Related1. I need guide on how to create a folder name from the text file with .txt format.
2. First, I call the function of reading the directory.
3. Then, I dont know how to do.
4. Finally, I close the directory
This is my source code in perl
## read text.txt file ##
open F, "from/$directory/text.txt";
read F, $buf, 9999;
close F;[/size]
This source code is used to print the folder with date format like "ddmm" d stands for day and m stands for month
if ($command =~ s/-O "(.*)"/-O "$websites/$month/$file"/)
Instead, I want to have the name from text.txt to be folder name
i have a file thunderbird which size 1.57GB, that files contain the email that had been deleted but fortunately not been compact so i still can retrive the email that had been deleted the problem the superior not give me the specific of the subject or date on the file.
Code:
X-Mozilla-Status: 0001(this number sometimes not same)
X-Mozilla-Status2: 0000080(this number sometimes not same)
what i need is change the contain number 0001 to 0 in X-Mozilla-Status not the X-Mozilla-Status2, is there any way to do, and the file contain so much text like that so i want to change automatically.
I have a simple log file which is very messy and I need it to be neat. The file contains log headers but are all jumbled up together thereforeI need to sort the log files according to the log headers. There are no static number of lines that means that there is no fix number of lines for the each header of the text file. And I am using AWK to sort out the headers.The Log files goes something like this:
Code:
Car LogFile Header
<text>
[code]...
I have a String like "A.words=Ajay,Anil" in file A.And it contains a lot of other information also. I wanted to replace "Ajay,Anil" with "Vijay,Vinay" with sed command with using existing file only(not using another file)
View 9 Replies View RelatedI have a few problem. I have a txt file that convert from pcap to txt file. What I want is to eliminate unwanted text from my txt file. Here is the example of the what I want to do:
This is original file in txt file
Quote:
No. Time Source Destination Protocol Info
1 0.000000 158.27.22.66 61.39.220.82 HTTP Continuation or non-HTTP traffic
0000 00 1f 9e 1a 5b 00 00 21 55 84 9a ff 08 00 45 00 ....[..!U.....E.
0010 05 8c e4 14 40 00 36 06 8d 1c 3a 1b 16 42 a1 8b ....@.6...:..B..
0020 dc 52 00 50 05 12 18 d4 17 f0 64 3f b0 94 80 10 .R.P......d?....
[Code].....
I have a simple log file which is very messy and I need it to be neat. The file contains log headers but are all jumbled up together therefore I need to sort the log files according to the log headers. There are no static number of lines that means that there is no fix number of lines for the each header of the text file. And I am using AWK to sort out the headers.
The Log files goes something like this:
Code:
Car LogFile Header
<text>
<text>
[Code]....