Software :: Combine And Partially Overwrite Text Files?

May 18, 2010

I need to overwrite the first say 50 or so lines of an xml file on an everyday basis. The first 50 lines of the file are always the same and the 50 lines they get replaced with are always the same. Is there a way to create a file with the 50 new lines and somehow copy/merge/overwrite the larger file such that the 50 original lines would be replaced but the remainder of the file would be untouched?This seems simple, there has to be a way to do it. I'm just not smart enough to figure it out.

View 2 Replies


Ubuntu :: Combine Columns In Text Files?

Feb 15, 2010

I have two files which I would like to combine. Each file has 2 columns.

File 1:
1 a
2 b


View 2 Replies View Related

General :: How To Combine Multiple Text Files

Mar 22, 2011

Combine multiple text files into one text file?

View 5 Replies View Related

General :: Match And Combine 2 Text Files Line By Line

Mar 21, 2011

This solution works but is slow with large files. I am looking for a faster solution.

The 2 files contain filenames, one of them has associated data I want to append to the other file's matching filenames



I append file2 by matching the unique_filenames and appending them with the tag data and some formatting

appended file2:

Here is the SLOW code

while read inputline.

View 9 Replies View Related

Software :: Join 2 Text Files Based On First Number Present In Every Line Of The 2 Text Files?

Jan 22, 2010

I have 2 text files : file1.txt and file2.txt

cat file1.txt

15 this is a sentence containing various words and spaces
34 this is a another sentence containing various words and spaces

cat file2.txt

2 this is sentence1file2
6 this is sentence2file2
54 this is sentence3file2

I would like to join these 2 files. The result should look as follows :

cat joinedfile.txt

2 this is sentence1file2
6 this is sentence2file2
15 this is a sentence containing various words and spaces
34 this is a another sentence containing various words and spaces
54 this is sentence3file2

==> so the joined file must be sorted on the first number. Any ideas how this can be achieved ?

View 4 Replies View Related

Programming :: Condense And Combine Two Log Files?

Jun 8, 2011

My backup script generates 2 lengthy log file. They have the same name, but the date is appended. I want to select the oldest one, condense it with "head" and "tail" and then append the condensed version of the newer one. They seem to get tangled up.Code:

ls `find . -iname "bak-log_*"` -1t | tail -1
ls `find . -iname "bak-log_*"` -rt | tail -1


View 2 Replies View Related

Ubuntu :: Combine MP3 Files Into A Single File?

Feb 28, 2010

I have an audiobook in 64 small mp3 files and I need them combined into a single file of any format in the proper order or order that I add them in. What program can I use?

View 9 Replies View Related

Ubuntu Multimedia :: Join(combine) Two .ogv Files Into One?

Nov 27, 2010

How to use ffmpeg or memcoder to join two .ogv files into a single .ogv ??Let's suppose the first .ogv video file is named as "01.ogv" and the resolution is 800*600;the second .ogv video file is named as "02.ogv" and the resolution is 720*576.I'd love to join two video files into a whole one, with the resolution 320*240.

View 1 Replies View Related

General :: Cannot Overwrite The Existing Files

Apr 15, 2011

I run a command in a Linux terminal, the result was written to the desied folder. After I modified the command and rerun it. The old files are still there and not overwritten at all. Only it is successfull after I deleted the old files and run the command.

View 3 Replies View Related

CentOS 5 :: Smbclient Can't Overwrite Files?

Jun 17, 2010

I'm using CentOS 5.5 with smbclient 3.0.33-3.28-el5 (latest version in repo), and I can't overwrite files in my smb store.The CentOS box is merely a client of the smb share,and I am not the admin for the Windows server that hosts the share, so there isn't anything I can do server side. But I do have write permission to the server. I'm 95% certain that the server runs Windows Server 2003.I can create a new file,but if I need to overwrite it I need to delete the file, and then copy the new version over.My Windows XP machine can overwrite files perfectly fine.

Using the cp command I'll get this error: (/mnt/storage/foo.txt already exists)
[jonescb@localhost ~]$ cp foo.txt /mnt/storage/foo.txt
cp: cannot create regular file `/mnt/storage/foo.txt': No such file or directory`

View 5 Replies View Related

General :: Combine / Merge Left And Right Video Files?

Jan 11, 2011

How can I join the two parts of a stereoscopic movie to get a side-by-side one?

I can expand the left file, that way all I'll need is to paste the second one on top of it, with something like this:

mencoder left-file.mkv -o side-by-side.avi -oac copy -ovc lavc -of avi -vf scale=1280:720,expand=-1280:0:0:0 -sws 3 -lavcopts vbitrate=16000

Any idea which tool should I use on a Linux system?

View 1 Replies View Related

General :: Shell - Shellscript Combine All Files Without For Loop?

Jun 12, 2011

I have hundreds of files in one directory, is there a simple command or pipes of command I can use to append them together? I don't want to use any loops.

View 4 Replies View Related

General :: Combine Two Files Column-wise In Ubuntu?

Jul 7, 2011

I have two files: one is like

chapter 1
the other is like

I was wondering how to column-wise combine the two files into one:

preface 1
Introduction 2
chapter 1 3

by using some utilities, such as awk, sed, available in Ubuntu?

View 1 Replies View Related

General :: Prevent Author New Files Overwrite Changes

Jun 29, 2011

I use software where I have to edit a text file in order to get my custom needs from it. Problem is that when the author puts out an update, it always overwrites my changes and I have to spend hours trying to compare the file, re-edit my changes back in, etc. This happens sometimes as often as once per month.

I've wondered if there might be a linux tool or commands which would look through the new file, then at my old file, changing only the text which already exists while not breaking anything else. Most software authors seem to know how to do this but since mine doesn't, how can I accomplish this on my own?

View 7 Replies View Related

General :: Doesn't Work Still Prompts To Overwrite The Individual Files

May 5, 2010

currently there's a xxx dir already in /home/yyy I'm trying to overwrite itcp -fr ../xxx /home/yyy/doesn't work still prompts me to overwrite the individual files. how do I fix it?

View 4 Replies View Related

General :: Windows - Linux: Can't Overwrite Files On Samba Store

Jun 10, 2010

I'm using CentOS 5.5 with smbclient 3.0.33-3.28-el5 (latest version in repo), and I can't overwrite files in my Samba store. I am not the admin for the Windows server that hosts the share, so there isn't anything I can do server side. But I do have write permission to the server. I know the server runs Windows XP or Server 2003; I don't know which. I can delete the file, and then copy the new version over, but I can't overwrite it. Using the cp command I'll get this error:

[jonescb@localhost ~]$ cp foo.txt /mnt/si_storage/foo.txt
cp: cannot create regular file `/mnt/si_storage/foo.txt': No such file or directory`

And if I edit a file on the server using vim, I can save it once, but if I save it again I get this: "/mnt/si_storage/foo.txt" E212: Can't open file for writing This is my /etc/fstab entry for the samba server: // /mnt/si_storage cifs username=myuser,password=mypass 0 0 I can overwrite files just fine on my XP machine. The CentOS box is the only one having problems.

View 1 Replies View Related

Fedora :: Bash Script - Combine Files So That The File Output Is PORT.80 TCP SRC=x.x.x.x United States

Oct 31, 2010

I am working on a script that allows me to convert an IP address to a country name. I have 2 files. One that has text like: PORT.80 TCP SRC=x.x.x.x and the other is x.x.x.x United States. How can I combine these files so that the file output is PORT.80 TCP SRC=x.x.x.x United States?

View 5 Replies View Related

Software :: Use Sed To Include A Text File In The Beginning Of Other Text Files Inside A Folder And Its Subfolders?

Jun 1, 2010

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

CentOS 5 :: Text User Interface To Configure Text Files

Nov 5, 2009

I would like to write a text user interface (TUI) to adjust some text config files etc. Is there a tool or application for creating TUIs like this. I�m talking about those types of config tools which you see executed at first boot.

View 19 Replies View Related

General :: Loop Append Text To Text Files?

Jan 15, 2010

may be an advanced question but I need to know how to do this. Here at work I am in charge of recruiting and we have about 1,000 resumes in already. All of the resumes are in a .pdf format. I need to rename every .pdf in the following format:{firstnameLastname}.pdfThe only way I know how to do this is to convert all the .pdf files to text, extract the name out of the first few lines of text, import into excel, and then use VBA to rename the files in mass:Here is my logic so far:~Deskop/a = houses all the .pdfresumesOpen terminal: Code: cd ~/Desktop/afor f in *.pdf; do pdftotext -raw $f; done That will convert all of the preceding resumes into text filesNow I would like to append the name of the text file into the last line of the text file. So, for example, for Resume1.txt, I want to append "Resume1.txt" to the last line within Resume1.txt. So after I run the command I open Resume1.txt and on the last line within I want to see "Resume1.txt" on the last line, at the end of the resume.How can I do this? I would like to use a loop and have the terminal append the filename to the body of the text file until all of the have been appended.

View 1 Replies View Related

General :: Search Text In All Text Files Of All The Sub-directories?

Apr 21, 2010

Currently, when I'm searching text in files of my PHP project, I use this line :


grep -r 'myTextToFind' *

But now, I would like to search only in ".lang" files. How can I do that ?

View 7 Replies View Related

Programming :: Finding A Utility To Combine Two Or More Binary Files Into A Single Binary File?

May 5, 2011

Is there any Linux utility to combine two or more binary files into a single binary file ?

View 7 Replies View Related

General :: Why Use Patch Files Based Upon Different When Can Directly Overwrite The Old File With The New File

May 29, 2010

i want to know why do we need to patch files based upon diff when we can directly overwrite the old file with the new file.

View 4 Replies View Related

Programming :: Command For Find/Replace In Text Files (inc. Files In Sub-folders)?

Oct 11, 2010

I found this command that works great finding and replacing a simple string to another in files located in that folder and all sub-folders.

Code: find . -name '*.php' | xargs perl -pi -e 's/OldText/NewText/g'

The problem I have is that I need to replace a more complex string, like this: Old string: /mnt/stor6-wc2-dfw1/627896/982574/ New string: /mnt/stor8-wc2-dfw1/369587/302589/ There I don't know how to do it... since the / is what separates the old from the new strings, and the strings that I want to replace have / in it. Also, I would like to know how to specify under what folder replace the files, for example, I want that it search/replaces all files under /var/www/mysite/htdocs folder.

View 1 Replies View Related

Software :: Differentiate Two Large Text Files Using Shell Script / Files Are Like Below?

Jan 20, 2009

I want to automate this using script.How to automate it?

File1: 1 name:aaaaaa


View 1 Replies View Related

Fedora :: Compression Ratio For Text Files / Binary Files

Apr 15, 2011

Fedora provides several compression techniques. E.g tar, tar.gz, zip etc. I want to know which among them provides

1. the best compression ratio for text files

2. the best compression ratio for binary files

3. fastest compression

View 6 Replies View Related

General :: Convert Open Office (odt) Files To Text Files?

May 25, 2011

How do you convert Open Office (ODT) documents to Text files?
I have made a report using libre office. Now I wish to continue editing the document using lyx (latex front end). So the ODT file needs to be saved as some .tex file.

I don't see an option to do this in File menu (export/save as). So is there any other plugin to do this?

View 1 Replies View Related

OpenSUSE :: Compose Key Works Only Partially?

Jun 4, 2010

My recent install of 11.2/KDE on a laptop suffers from a strange misbehaviour of the compose key (I have declared the Windows and Menu keys as Compose). It appears that two different sets of composing sequences are active, depending on the application.

I have to explain that I use a lot of unusual characters on a regular basis and therefore keep adding more sequences to /usr/share/X11/locale/en_US.UTF-8/Compose. I have even redeclared a couple of predefined sequences to values that are more useful for me. All these work fine, for example in a terminal window (konsole or xterm) or in konqueror, or even in OpenOffice.

However, other applictions seam only able to handle the default set of Compose sequences. This applies, for example, to Firefox or Gimp. It does not matter whether they are invoked from the command line or from a desktop icon. I tried both the Firefox shipped with OpenSuse, and a download from Same result.

I tried to delete other Compose files from /usr/share/X11/locale/* but it did not help. I wonder where the default rules are actually found after deleting all the Compose files, even if (for some reason) the locales have changed in these applications.

View 2 Replies View Related

Fedora Installation :: How To Fix A Partially Successful Upgrade

Jan 19, 2010

I hit some trouble upgrading from FC 10 to FC 12 using the netinst CD. I had previously successfully upgraded the system from FC5 to FC10 with the same method - that time everything went well. At first the upgrade went well - the installation program found my FC installation and detected the partitions right. The problem appeared when about 90% of the rpm's were installed. Anaconda was complaining about a fatal error with a package and quit.

After rebooting and restarting the installation program it does not recognize my partitions anymore and suggests I'd format them for a fresh installation. As all my data is there I'd rather not do that. I then rebooted again and chose "Repair" from the installation menu. I got to the console and noticed that all partitions mounted cleanly and all the data seems to be there. Trying to reboot from the hard disk almost works. The system gets up, goes through grub, gets the kernel running and mounts the disks but fails to launch Xorg.

I get to a terminal login from here by pressing Ctrl+Alt+F2. When I type the user name and press enter the terminal seems to crash - does not ask for the password but simply returns to the user name query. An error message flashes just after pressing enter but too quickly for me to read. When I boot from CD again and go to the terminal via the "Repair" option the previous events can be seen from /var/log/messages. Xorg tries to start and stops trying after a certain amount of failures. After that it says this:


init: prefdm main process (2123) terminated with status 1
init: prefdm main process ended, respawning
init: prefdm respawning too fast,stopped


My best guess is that this happens because the upgrade was aborted before it completed and hence some necessary rpm's were left out. I figured I could possibly fix this by updating the packages with yum from the terminal if I got to log in. What should I do now? Could I for example try and manually copy some missing files to the disk as I can access it via the repair option?

View 12 Replies View Related

Ubuntu Servers :: Server Is Partially Unresponsive?

Jul 16, 2010

I have a remote server which has been working perfectly for about 1 year. It is in a secure location and used for serving a local web-app, and we remote administer it through an OpenVPN tunnel, and previously a Hamachi tunnel.It has in the last few days become partially unresponsive. What I mean is that I can ping it fine through the VPN, and I can SSH into the box, but when I try to run some commands, it seems to freeze partway through, and I get the output interrupted and a blinking cursor. I have also tried to access the web-app through the VPN and while the page header in the browser changes to the correct page name, the actual page does not load.A reboot does not seem to have cleared the problem, although I cannot be certain at this moment that the reboot command actually completed, or froze partway through

View 4 Replies View Related

Copyrights 2005-15, All rights reserved