General :: Replacing A String In A File With The Contents Of Another File?

Jun 15, 2010

I would like to know how I can replace a string in one file with the complete contents of another life.

View 10 Replies


ADVERTISEMENT

Software :: Check The Contents Of A Text File For A Specific String And Remove It From The File From The Command Prompt?

Oct 14, 2010

I want to be able to check the contents of a text file for a specific string and remove it from the file from the command prompt. I would basically be searching through a number of files and if a specific string is found I would like it removed automatically. pretty much a find and replace, were the replace is nothing. any one got any ideas on how you would do this. I already have the search part sorted just need to be able to remove the string I don't want from the multiple files.

View 4 Replies View Related

General :: Use The Diff Command To Get The Difference Between A String Of Text And The Contents Of A File?

Mar 31, 2010

I am not especially cli adept so could someone tell me the best way to use the diff command to get the difference between a string of text and the contents of a file instead of between the contents of two files?

View 3 Replies View Related

General :: Rename A File By Replacing Specific Letters In The File?

May 11, 2010

I used a script that renamed my file eg 'echo webutil.olb | tr [A-Z] [a-z]' i wanted to rename it back to webutil.olb. How do i do this for many other files that i have

View 3 Replies View Related

General :: Parse File From Remote Server To Caculate Count Of String Existence In That File?

Aug 30, 2010

I need to parse the file of same name which exist on different servers and calculate the count of string existed in both files.Say a file abc.log exist on 2 servers.I want to search for string "test" on both files and calculate the total count of search string's existence.For example if file abc.log on server 1 has string "test" 2 times
and file abc.log on server 2 has string "test" 4 times.then the output will beStringName : Countexampletest : 6 timesNote : I have created the password less connectivity using ssh-keygen.

View 2 Replies View Related

General :: Grep The Contents Of A File With Another File?

Sep 25, 2010

someone once told me that use can pass a file to grep and use that to search the contents of another file. if that is the case I'm not entirely sure why the following isn't working for me.

Code:

[root@LCENT01:~]#grep -i id_rsa.pub .ssh/authorized_keys
[root@LCENT01:~]#cat id_rsa.pub >> .ssh/authorized_keys
[root@LCENT01:~]#grep -i id_rsa.pub .ssh/authorized_keys

View 3 Replies View Related

General :: Replacing Text In A File?

Jul 26, 2010

how 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

View 4 Replies View Related

General :: Replacing Dot In String But Leaving Last One?

Jan 17, 2011

Possible Duplicate: replacing dot in string, but leaving last one replace the "." [dots], but leave the last one: e.g.: .txt [there could be random number of dots in the string, even zero, i just need the last one]

$ echo 'someth.ing.something.txt' | SOMEMAGIC
someth-ing-something.txt
$

View 1 Replies View Related

General :: Replacing The Text In Same File Using SED Command?

Oct 11, 2010

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 Related

Software :: Overwrite The Contents Of A File Without Changing The File Size?

Jul 12, 2010

We have some large files with sampling data in it. Don't want to delete these files. But want to quickly overwrite the file with 0s and/or 1s and preserve the original file size.

View 3 Replies View Related

General :: Replacing A Numeric String With A Sequence Of Numbers?

Jun 21, 2009

I have a text file with content that look like this..

Code:
1,3927,"AIS"
1,6928,"AIS"

[code]...

View 13 Replies View Related

Programming :: Append Contents Of One File To Another Existing File?

Nov 17, 2008

I have two files list1.cfg and list2.cfg both files contains differentrecords details like

List1.cfg
NAME1:25:C:NAME LINE1:
NAME2:25:C:NAME LINE2:
CITY:25:C:City:

[code]....

Now I want to append contents list2.cfg to list1.cfg(It ispposible using cat list2.cfg >>list1.cfg) but I want to check if content of (record) in list2.cfg is present in list1.cfg then dont append it otherwise append it.

View 1 Replies View Related

General :: Replacing Word Occurrence With An Increasing Number In A File Using Bash?

Aug 2, 2010

I have a file in the form below, and wish to replace each start line with an increasing number. So instead of:

Code:
start
content content
start
content content
start

[Code]....

After several searches and a bit of messing around, it's clear I'm missing something, so was wondering if anyone could offer any insight?

View 17 Replies View Related

General :: Ubuntu - Can't See Contents Of File

Jul 29, 2010

In Ubuntu 10.04, there is a certain file that appears highlighted in terminal. When I try to cat the file, it says there is no such file or directory. How can I see what's in this file? Is this a symbolic link?

View 1 Replies View Related

General :: Listing Of Zip File Contents Using C?

Oct 20, 2009

how to do the listing of zip file contents using C?

View 1 Replies View Related

General :: Reading Contents Of PDF File?

Jun 8, 2011

is there any API to read content of PDF file & store it in buffer?

View 14 Replies View Related

Programming :: Check If File Contents In Another File?

Nov 4, 2009

i am trying to write a bash script. i have a text file called comp2.tmp which has a list of items in it

example comp2.tmp

Code:

filename.pdf
filename2.zip
filename3.ttf
and so on

I have another text file called comp1.tmp which should have the same list of files in it, but does not look as pretty

example comp1.tmp

Code:
someothertext here ...... 10/30/2009 ...... filename.pdf
=========================------------------==============
othertextagain .......... 09/28/2008 ...... filename2.zip
========================------------------===============
bunchmoretext ........... 04/12/2005 ....... filename3.ttf
and so on

i would like to check if the filenames listed in comp2.tmp exists in comp1.tmp

View 3 Replies View Related

Programming :: Variable String File Base - Output File Doest Not Exclude The Values In Grep -av

May 1, 2011

My script.

This is may script:

Code:

Problem: Output file doest not exclude the values in grep -av

View 3 Replies View Related

Programming :: Perl Find File And Then Replace String In File

Jul 28, 2009

I have script that I'm working on that updates a username in all the files that are called blah.inc for my framework. since i host a bunch of these web apps i need to do it to all of them. so I need to figure out how to update these files automagically with out me watching it to call vim every time. heres what I have so far

Code:

This finds the files but now i need to figure out how to do s/bob/fred/g on those files.

View 5 Replies View Related

General :: GUI Tool To Extract Iso File Contents On (KDE)?

Mar 3, 2010

I have an ISO CD image file and want to extract it's contents to a folder. I know there are ways to mount the image and stuff, but it's complicated. I'm looking for a GUI tool to open up the contets and extract needed files. On windows I would use WinRar to do this. K3B only allows me to burn the stuff, Arch does not work with ISO files :(Is there a similar tool on Linux, preferably from KDE world?

View 6 Replies View Related

General :: Reading The Contents Of A .bkf File Using A Non-Microsoft OS?

Apr 20, 2010

I have a .bkf backup file, created by the Backup utility that Microsoft provides with Windows XP. Is there a way to read the contents of the file using a non-Microsoft OS, preferably Mac OS X or Linux?

View 1 Replies View Related

General :: Zipping Folders And Their Contents Into A .zip File?

Nov 23, 2010

How do I make a .zip file that contains every file AND every folder in the directory?

View 4 Replies View Related

General :: How To Edit Contents Table Of Pdf File

Jul 17, 2011

how do i edit the "contents" of a pdf file. I tried pdfedit but I cant find where the content table list is stored.

View 1 Replies View Related

General :: Way To View The Contents Of A Berkeley DB File?

Jul 1, 2011

As the topic title states, I would like to know the preferred way of viewing the contents of a Berkeley DB file. The machine the file is on is running SuSE 9.3, with perl 5.8.6 and php 5.2.0 installed. (I'm not sure if stating that was necessary, but my understanding is that the more information I can provide you, the better. The purpose to this question is this: I have been requested to look into coming up with some form of Geocoding software for one of my company's clients. Specifically, I've been requested to look into trying to obtain Census tract/block information.

I discovered the Perl module Geo::Coder::US, which uses Census input (TIGERLine files) to create a Berkeley DB file, then reads said file to produce its own output. However, the output from Geo::Coder::US only provides latitude and longitude information.At the moment, my only interest is in popping the Berkeley DB file generated with the import script packaged with the Geo::Coder::US module. I'm trying to see what the contents of that DB file are, so I can determine if the information I'm after is even in there in the first place.

View 2 Replies View Related

Software :: Replace A Text String In A File With A Random String - With Sed ?

Sep 2, 2010

I have a line in a text file that has 40 random characters within a tag and i want to change the characters to a new set of 40 random characters (alphanumeric a-z 0-9 etc)

The line in the text file looks like this:

Quote:

How would i go about doing that?

Also second question same as the above but how would i remove them instead of replacing them?

View 14 Replies View Related

Ubuntu :: Find File Name And File Path From A String?

Feb 28, 2010

How to find filename and file path from a string

View 7 Replies View Related

General :: Shell Command To Display Contents Of A File?

Feb 23, 2010

shell command to display contents of a file? Like that of .txt or .html

View 9 Replies View Related

General :: Way To Report Contents Of File Cache Held On RAM?

Nov 30, 2010

Is there a way to report the contents of the file cache held on RAM?

View 1 Replies View Related

General :: Extract The First Few Contents Of A Zipped File And Then The Next Fixed?

Oct 30, 2010

I want to know if there is anyway I can extract the first few contents of a zipped file and then the next fixed and so on? For example, suppose I have a zipped file containing 1000000 natural numbers and I want to extract the first thousand numbers and then the next thousand numbers (1001-2000) and so on till I reach the end. Is this possible?

View 3 Replies View Related

General :: Grep Contents Of File On Remote Server?

Sep 24, 2010

I am attempting to grep the contents of a key file I have SCP'd to a remote server. I am able to cat it:

Code:
[bluethundr@LBSD2:~]$:ssh root@sum1 cat /root/id_rsa.pub
root@lcent01.summitnjhome.com's password:

[code]...

View 5 Replies View Related







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