Programming :: Script To Copy Paste Text From One File To Another (overwriting Part Of The File)?

Apr 19, 2011

I have a .txt-file with ~50.000 lines of numbers, generated by a mathematics program. From this file, I need line ~ 1.100 to line ~16.000 (these lines are always the same btw, this may make the solution easier, dunno) to be copy/pasted to another file, where the lines ~500 to ~15.000 (also, every time the same) should be overwritten by the aforementioned lines...I haven't found or come up with anything that works yet, mostly I find solutions to copy everything from one file to another but I can't find something to specifically overwrite a part of a file with part of another.

View 4 Replies


ADVERTISEMENT

General :: Copy Some Text In One File And Paste It To Another File?

Sep 19, 2009

favor 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 Related

Programming :: How To Avoid Overwriting A File

Sep 6, 2010

I'm facing difficulty while writing to an already existing file . I'm making a shell (programming in C). I want a file (say , logfile) to keep a record of all the commands a user enters. For the first command it runs fine , but for the second time and thereafter it overwrites the previous contents. How do I avoid this?

View 3 Replies View Related

Ubuntu :: Copy File But Paste Link

May 29, 2011

Has anyone seen a seamless way to create a symbolic link via a GUI based file manager? I have been using PCManfm because I find it fast, but I can copy the file but paste a symbolic link instead of the actual file.

View 9 Replies View Related

Fedora :: Copy Text From An Application In The Host Machine And Paste The Text Into A Different App?

Feb 10, 2011

I'm running and XP virtual machine using KVM / QEMU. THere are time when I need to copy text from an application in the Fedora host machine and paste the text into a different app in the XP guest machine. I was able to do this using Vitualbox on an earlier version of Fedora.

View 1 Replies View Related

OpenSUSE :: Copy - Paste - KMail - Not Only The Marked Text Will Be Pasted But A Kind Of HTML Code Including The Text

Jan 10, 2011

since some days I have a strange problem with KMail (1.13.5) in KDE4.5.5. When I try to copy some text from an email and past it to any other program (e.g. Openoffice), not only the marked text will be pasted, but a kind of HTML code including the text.

This bug is not OpenSuse specific. I found the same bug in a Fedora mailing list (of course, whithout an answer): Strange Copy/Paste behavior in KMail 1.13.5/Kontact 4.4.8

View 6 Replies View Related

CentOS 5 :: Kickstart File Post - Copy / Paste Scripting

Feb 23, 2010

I want to design a kickstart file that creates an unattended installation (I've passed that part). After it installs, I want it to automatically read the device's MAC address and change the hostname to match the MAC address with the separators removed. (For example if the MAC address is 01-02-03-04-05-06, the prompt after login should read "root@010203040506")

I know this is entered in the "%post" section of the kickstart file, and I know I'm supposed to use the "cut" and "sed" commands, but I have no idea what I'm doing or how to do it. script so I can copy/paste it into my kickstart file?

View 5 Replies View Related

Programming :: Remove Lines In A Text File Based On Another Text File?

Jan 28, 2009

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

View 10 Replies View Related

General :: How To Print Part Of Text File In Bold And Color

Jul 6, 2011

I have a procedure say X
output of X is :
Fund name: Mutual
NAV is: 1234

So I appended this output into a file using shellscript. But now my requirement is changed. The part of output like Fund name and 1234 should be in bold. How can I do this using shell script.

View 14 Replies View Related

Programming :: Bash Script To Copy Without Overwriting?

Oct 21, 2010

i have one questions :"bash copy filename destin_dir"1- i need a bash script to copy file from one directory to another , and if the destination directory have the same file name, add '_1' to the file name ..and if there is a file with 'filename_1' , add '_2' to the file name and become 'filename_2' and so on

View 5 Replies View Related

General :: Overwriting The Middle Of A File From A Block Device *without* Truncating File?

Jan 15, 2010

I have a Linux (Kubuntu) system with a large (~20Gb) file which I would like to mess with. Specifically, I want to copy the entire contents of another large file (~12Gb) to the middle of this file, and keep the bits of the file which are not overwritten.This is what I want to happen, with the text between the pipes representing file contents:Before:

outfile: |abcdefghijklmnopqrstuvwxyz|
infile: |123456789|
After:

[code]....

View 1 Replies View Related

Ubuntu :: Select, Copy And Paste Text From .pdf?

May 5, 2011

Ubuntu 11.04Adobe Reader 9I can't highlight/select text and copy and paste it to another file. It worked for me on previous version. Please advise how to make it.After installing OpenOffice pdf extension on LibreWrite I can import .pdf but still I can't find the select/copy/paste functions.

View 9 Replies View Related

General :: Copy And Paste Text Among Documents In Terminal

Mar 28, 2010

What is the best way to copy and paste some text among text documents in Linux terminal environment? Suppose I have 2 documents, A and B, and I want to copy some part of A to B. What is the way to achieve this?

View 5 Replies View Related

General :: Copy/Paste From Nano To An Outside Text Editor?

Mar 27, 2011

I am trying to copy paste from a file in Nano to a text editor outside of nano on my machine (I am running windows using Nano through Putty) and I cannot figure out how to do it. I can select with mouse support enabled everything that I want to in Nano and I can cut it, but when I try to copy into my other text editor, it does not work.

View 4 Replies View Related

General :: Unable To Use Shift + Insert To Paste And Copy Using Text Selection?

Mar 9, 2010

know what can be done to enable the "select text to copy" and "shift+insert to paste" features in linux.

View 2 Replies View Related

Programming :: Copy One File Content To Multiple File

May 28, 2010

I wanted to copy one file to multiple new files. I have an idea to write a script and do the operation. But here i m looking for any particular command to do this operation.

View 1 Replies View Related

Programming :: Extract Part Of File Name?

Mar 26, 2010

I have this string ./DAT000728-652523058.job.I want to extract the no between DAT and - sign. I want 728. I dont want 000728.echo ./DAT000725-560162365.job | cut -d'T' -f2 | cut -d'-' -f1 I am getting 000728.string can be ./DAT326822-652523058.job also. then i need 326822

View 6 Replies View Related

Programming :: Replace Part Of A File With Another?

Jan 8, 2010

There are a few things I was wondering about (using tools available in bash):How to insert a file at at the specified location of another.How to copy a portion of a file between two lines matching a regex to another file (and/or making sed only work between two lines matching a regex)How would you do this?

View 2 Replies View Related

Programming :: Create A Duplicate File Of A Text File In PHP?

Nov 11, 2010

What I plan to do is, create a duplicate file of a text file, and then append some text into the new text file.

View 1 Replies View Related

Programming :: Script That Takes A Part Of A Log File And Emails It?

Mar 22, 2011

I work for a company that does remote computer support, we use VNC protocol to help our clients. I installed a VNC repeater that allows my clients to connect to me going through all firewalls and port forwarding. The linux VNC repeater outputs all connection information to /var/log/vnc.log and looks something like

Code:

UltraVnc Linux Repeater version 0.14
UltraVnc Tue Mar 22 03:37:02 2011 > routeConnections(): starting select() loop, terminate with ctrl+c
UltraVnc Tue Mar 22 03:37:12 2011 > acceptConnection(): connection accepted ok from ip: 55.555.555.55

[code].....

I need a script that reads this log file every so often (30 seconds to 5 minutes) and sends an email when an connection has been accepted. I looked into reading log files and got this so far

Code:

LOG=/var/adm/sqllog
while true
do
tail -100 $LOG | grep "ORA" > /dev/null

[code]....

View 10 Replies View Related

Programming :: What Is The Terminology Called Of A Binary Using A File That Is Not Part Of It's Self

Feb 14, 2011

What is the Terminology called of a Binary using a file that is not part of it's self? An example would be when a browser uses a HTML file for it's interface. The binaries code has to know how to find it and so on. I imagine that the applications binary uses a system call and that another application takes over.

View 1 Replies View Related

General :: Make Ubuntu's Terminal Program Automatically Copy To Clipboard Selected Text / Paste

Jul 6, 2011

i'm used to using putty on a window's machine.With putty whatever you select is automatically on the clipboard without having to right click and select copy.And right click just pastes.

View 1 Replies View Related

Programming :: Extract A Part Of Flat File In Shell Script?

Feb 12, 2010

My rquirement is I have a flat file with lot of lines on it.example:

line1
line2
line3

[code]....

View 8 Replies View Related

General :: Copy Code From Text File To Command Prompt?

Dec 2, 2010

First I hope to undrestand my English word because Iam Arabic girl and not so good in English...

my problem is:

I wrote code in .c file and I run that code on the prompt command, its ture but I want after the out put copy the code on the command by some statment in the code , how can I do that?

View 3 Replies View Related

Ubuntu :: Copy Folder Location And Save In Text File?

May 17, 2010

I want to copy location of every .avi , .jpg file present in a folder or in subfolder present in a direcotry and save in a textfile how to doex : /home/username/Desktop/bookofeli/video/book.aviit should give full locaiton of path how to do

View 2 Replies View Related

Ubuntu :: Enable Full Text Copy Of A Locked Pdf File?

Sep 17, 2010

I have an ebook that has copy protection on; only 25 pages can be copied every 14 days. This is very annoying, as I need to copy more pages for my study group.

how I can enable full text copy of a locked pdf file?

View 5 Replies View Related

Programming :: Adding Lines Of Text To Beginning Of Text File

Jan 19, 2009

I 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 Related

Programming :: Delete Line Of Text From Text File Via Shell?

Jan 13, 2010

I 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 Related

Programming :: Exporting Glade Text View To Text File?

Jan 8, 2011

I 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..

View 8 Replies View Related

Programming :: Formatting Fields And Text Being Displayed From Text File?

Feb 9, 2011

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 (.

View 15 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved