Programming :: Replace Html In Multiple Files (80+)

Mar 2, 2010

I want to change some HTML in my files (80+ so I prefer not to do this by hand). I got a script to replace a string in files, however the HTML I want to replace contains an enter (and tab of 4 spaces) (explanation below) Does someone know how I could update my HTML by using a function in Linux?

I also found sed but don't know how to use it with the enter (linenumbers will not work because they variate)...

[Code].....

View 2 Replies


ADVERTISEMENT

Ubuntu :: Replace Multiple Lines In Multiple Files?

Aug 20, 2011

I often use the rpl command to make changes to multiple html files at once. For example:

rpl -R '<br />' '<br /><br />' mydirectory However, I haven't been able to figure out how to change multiple lines. For example, let's say I want to change all occurrences of :

<br />
<br />
to:
<br />
I've tried
rpl -R '<br />
<br />' '<br />' mydirectory

but that didn't work. how to do this with rpl or some other way?

View 9 Replies View Related

Ubuntu :: Creating Readable File From Multiple Html Files

Oct 2, 2010

Here is the deal: my school purchased a test prep which they distributed to us, the only problem is that it is for windows. When I try to run the exe in wine the program windows pops up but the screen is blank (i can see the menu bar and and the title bar). It appears that most of the information is located in a folder as html files (separated into chapters for each section) with links to all the figures/tables/questions
(also html files). This morning I have been trying to find a way to compile the html files into a format that I can read without having to hunt for each individual html file. I tried navigating with firefox but had to change each individual link before I could do that (very time consuming), I tried using doxygen (the GUI front end) to convert it to Latex/rtf/html/xml (all the formats) but did not have any success (It could be that I am using the app wrong). I tried opening some java applications found within the application data folder in hopes that it would bring up the navigator without success. And even tried installing java in wine (unsuccessfully) to see if that was the missing key to run the program in wine.

My question is, do I just have to fork out the $500+ that it would cost me to purchase the books instead of using the school provided program (free to us)? or is there a relatively simple way to compile these files into a format that could be readable.

tl;dr - have multiple html files for a windows native program that won't run on wine that I would like to convert to a more easily readable format (i.e. chm, pdf, etc), is it possible?the program was legally acquired through my school, I did not download or pirate it. I am not looking to distribute it, just looking to use it for my own studying purposes without spending $500+ or buying a windows license/computer.

View 2 Replies View Related

Ubuntu :: Replace String In Multiple Files Using Sed?

Jul 4, 2011

I am trying to replace a string (url) in 100s of files located in different directories. I found the sed command but cannoy get it to work. First I locate the files that have the string in them:

Code:
grep -ilr 'url' *
this works correctly and displayed the location of the files that have the string:
Code:
1/index.php
2/index.php

Now I need to replace the string so I combined it with sed:

[Code]...

View 3 Replies View Related

Server :: Find And Replace In Multiple Files In Ssh?

Jul 3, 2010

Find and replace in multiple files in ssh?

View 1 Replies View Related

Programming :: Awk Multiple Line Search And Replace?

May 1, 2011

I am trying to search and replace a multi line pattern in a php file using awk.The pattern starts with

<div id="navbar">
and ends with
</div>

[code]...

View 3 Replies View Related

Programming :: Find And Replace Multiple Instances?

Aug 13, 2010

I have a file with the following in it:

:0 local /usr/X11R6/bin/X -nobanner
:1 local /usr/X11R6/bin/X

I need to add "-nolisten tcp" to both of these lines and cannot figure out how to do it. I can get it to do the first one, but not the 2nd and so on. How do I search the file and loop though it to change them all?

View 14 Replies View Related

General :: Find & Replace String In Multiple Files?

Jan 15, 2010

After hours (literally) of searching the web and reading man pages, I think I've come up with the following:Code:find . -exec grep 'path/to/file' -print | xargs -0 -I new_path mv {this is where I get confused}So my code above is incomplete, obviously. In order to finish replacing the string, I need to mv the new file into the old file's spot. How do I do this, by incorporating it into my line of code?

View 14 Replies View Related

General :: Search And Replace Line In Multiple Files?

Jul 13, 2010

Hello, I need some help searching through multiple files, finding a line and replacing that line. The line I am searching for is:

password key ******* 1222554

ultimately I want to be able to delete the numbers after the asterisks . my thoughts are to create a script that will search for the line password key ******* and delete it then replace it with password key ******* my files are located in /opt and they are all txt files.

View 13 Replies View Related

Ubuntu :: Command Line - Find And Replace Text Within Multiple Files?

Aug 28, 2010

I'm pretty sure this is doable from the command line, but my CLI skills have degraded a lot since my pre-Y2K admin days. The goal is to search all the files in the directory for a very long string of text and replace it with another string of text. The text being searched for is my Google Adsense code (which will be stripped from my website) and it will be replaced with a placeholder so I can easily tack something else in there in the future.

Seeing how I have that long snip of code on about 100 pages, automating the process would make life easier.
If I was searching for a single word, I can see ways to do this.
If I paste the code I'm searching for into a text file, is there a way to:
find (contents of oldstring.txt) and replace with (contents of newstring.txt)?

View 9 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

Programming :: HTML / PHP Access To Files And Hanging Directory?

Oct 1, 2010

Code:
<html>
<head>
</head>
<body>

[Code]....

Alright this works fine to pull the directories/files in the /var/Store/2010/ directory.

But when you click on of the links it tries to http://'serveradress'/$filename

note that $filename in the url is the filename clicked on so the php script is working. but I need it to change to that dir so that you can see the folder/files there and work your way up/down/side wise thru the folder tree to where you need to go. Not try and pop it as a direct url which doesn't work.

View 3 Replies View Related

Programming :: UTF-8 Or Locales - Cannot Get Html Files On Pc To Render Properly

Jun 10, 2011

I cannot get some html files on my pc to render properly, Epiphany and Iceweasel show some non-latin characters as garbage but shows others of the same language correctly although Gedit shows the same files, with or without the html code, correctly. I have all the locales installed. Can someone point me to a solution? I am misleading you when I say "garbage", it is always a pair of question marks.

View 5 Replies View Related

General :: Replace ":" From Multiple Files Names - Even Recursively In Directories

Jan 31, 2010

I need to replace ":" from multiple files names, since I am going to copy those files from a linux partition, which admit the ":" to a FAT32 partition, which does not.

Example:
original name: eg06_ana_21-05-06_09:21:03.JPG
wished name: eg06_ana_21-05-06_09-21-03.JPG

I have googled a lot but I have not been able to adapt the examples given by people to my aim.

It seems that rename command is what I should use, but I have no idea to build the correct pearl expression.

View 3 Replies View Related

Programming :: Replace Occurrence Of A String In Many Files In One Command?

Oct 30, 2010

I used a command Code:

grep -r err_sys ./
its output is
Code:
./tcpclitime.c:err_sys("socket error");
./tcpclitime.c:err_sys("connect error");
./tcpclitime.c:err_sys("write error");
./tcpclitime.c:err_sys("shutdown error");
./tcpclitime.c:err_sys("read error, n = %d", n);
[Code].....

Is it possible some how to replace all the occurrences of word err_sys by printf.

View 1 Replies View Related

Programming :: Client Side To Include HTML Within HTML?

Sep 12, 2009

what is the best way (i.e standard way that is supported on all browsers and probably as well followed by web crawlers).... to include an html file either locally or externally in another ? Of course , i've done the research and i also know that there are server side includes (php , asp ...you name it) at the moment , i'm using this:

Quote:

<script type="text/javascript" src="path to file/include-file.js"> </script>

however, i've been warned that this method may not show up in some browsers as some tend to ignore this tag and that crawlers like your favorite search engine wouldn't bother reading this. so , what is the best and safest way to do the job? and btw , the reason why i've ousted SSI's from the start is because of among other things:

1) the fact that the included file is static html and because the text is included pretty much everywhere

2) hoping to reduce load time as the code (if successfully recognized) would hopefully be treated like any other embedded external file (e.x like an image) , therefore it would be cached without the need to downloaded it over and over again for each new page on the site.

View 1 Replies View Related

General :: Remove <br> Html Tag And Replace With Newline

Dec 2, 2009

I've been playing around with sed but can't find a way to remove the <br> html tag and replace it with a newline. Sed isn't truly needed awk or other suggestions could be good.

View 3 Replies View Related

Fedora :: Conditionally Replace An HTML Tag In A Large File?

Mar 28, 2011

We receive this large file which is generated as a HTML page.So anybody can view it with a web brower.A few lines from this file ...

Code:
<tr><td><font color="#555555" size="3" face="Tahoma, Arial, Verdana, Helvetica"> 1999 <font color="#cc6600" size="5">←</font> <font color="#0066ff" size="4">03</font>-27

[code]...

View 8 Replies View Related

Programming :: Getting A Script To Be Run On Multiple Files?

Apr 17, 2009

I use a mencoder line to convert .avi to .mpg (dvd player compatible), it works well but i can only do one file at the time. It requires giving the input and output directories and the files name. I tried using (*.avi *.mpg in the command) on the directory but it just add up all the .avi and convert them into one huge .mpg. My goal is to have a script that would convert all the .avi files from a directory to the same amount of .mpg and also keep the naming of those files. Here is what i work with on single files:

Code:

mencoder -oac lavc -ovc lavc -of mpeg -mpegopts format=dvd -vf scale=720:480,harddup
-srate 48000 -af lavcresample=48000
-lavcopts

[code]....

View 3 Replies View Related

Programming :: Redirect To Multiple Files?

Nov 12, 2010

I feel kind of embarrassed posting here, but this is technically a scripting sub-forum. Here is the problem. I have a folder with various files which include .txt files as well

How can i redirect same content to each of the .txt files in the folder?

I have tried
Code: $ echo "hello" > *.txt
-bash: !": event not found Code: also cat ~/otherdir/test.txt > *.txt
-bash: *.txt: ambiguous redirect Can anyone help me with this?Ok i solved it
Code: #! /bin/bash
for file in *.txt
do
echo "Text that needs to be written" > $file
done

View 2 Replies View Related

Programming :: Grep Multiple Files ?

Dec 30, 2010

I want grep multiple files:

let abc.1.abc.2,abc.3,abc.4

I use grep <pattern> abc.* to read the files. But here grep read files in the order of 1,2,3,4 . I want to to grep the files in reverse order like 1st the abc.4 file will be read and abc.1 file will be last.

Is this possible ?

View 3 Replies View Related

Programming :: Multiple Files To Compile By G++?

Jan 12, 2011

how i could compile for example: a tutorial file of cantera open source files. when i do :g++ example.cpp -o examplei get huge errors such as the header files are not here,...please tell me how i could compile it. ofcourse i have configured the full opensources and i see in /usr/local/cantera/binthat the files are there but i still can not compile and execute any cpp file.

View 2 Replies View Related

Programming :: Execute Multiple Sql Files Using Scripting?

May 19, 2010

My query is i have a.sql , b.sql , c.sql files which needs to be executed using "$ db2 -tvf a.sql"; "$ db2 -tvf b.sql"; "$db2 -tvf c.sql" , script with which i can execute all these sql files in a single shot.

View 4 Replies View Related

Programming :: Reading Data From Multiple Files?

Mar 17, 2011

I have a folder which includes bunch of folders each having data files in them. [ Folder A has F1, F2 F3 ..... F1000 folders in it, and F1, F2, F3 ... each has about 10 different files named FILE 1, FILE2, FILE3 .... in them.

I am interested in File 1 of each Folder, because that contains the data I need in it. More specifically, that File1 s have a line "ANSWER=..." in them, and i need to get that value of the ANSWER from each file. So doing it by hand is so hard, so I need to write a script that will scan all folders and give me a list of values of eache ANSWERs.

View 4 Replies View Related

Programming :: Quickest Way To Do Multiple Searches For Files

Apr 15, 2010

I am looking for the quickest way to do multiple searches for different files.Here is the scenario: I want to search for various icons one by one in a script. Preference is for the gnome icon theme.

The echo piped into grep part seems to take a long time. Is there a quicker way of doing this?I do not want to use slocate, sqlite or the like since that will require admin privileges to update the database and/or extra dependencies.

View 5 Replies View Related

Programming :: Calling Multiple Files In FORTRAN90

Oct 29, 2010

I have written FORTRAN code to calculate density profile. This code will open two files ( topology and x,y,z trajectory). The trajectory file contains XYZ data coordinates for multiple frames (about 20 or 100 frames for instance). One frame contains 20736 data.

Previously this code was written to open ONLY one input XYZ data file and do the calculation and would dump the results in separate file and it was running without problem. Recently my data file get bigger in size, so I decided to break the single XYZ data file into few small parts.

Now I have modified the code so that it calls the parts of the XYZ data files ( eg: maltoTHERMO_10Frames.traj, maltoTHERMO_20Frames.traj,... and so on) and do the calculation and dump the results in the same result output file. I have tested this code just with openning the XYZ coordinates and printing into another file to see wheather it collecting the data sequently and it was working fine.

This code supposedly read the x coordinate data and calculate distance and put a count accoding the criteria in the approperiate bins. But when I let the code to do the calculation it stop and shows error. (I have indicated as !** in the code). If I enable this line, it shows error but if I disable this line, than the code do collect only the XYZ coordinates.

The code is as below:

Code:

module all_parameter
integer,parameter :: MAXATOM=20736!CHANGE
integer,parameter :: midwater=1500
integer,parameter :: TOTALFRAMES=20

[Code]....

View 8 Replies View Related

Programming :: Compiling And Linking Multiple Files Using Gcc?

Mar 13, 2011

compiling and linking using gcc: What does a file name with a suffix '.a' represent? If I have multiple .c and .h files, how can I link them together? How can I create the .a file?

View 6 Replies View Related

Programming :: Copying Multiple AVI Files To NAS Server

May 18, 2009

I am working with DM355 target board. Here we record. The video coming from IP cameras. Now I have to write c program for copying. The recorded avi files with date and time to NAS server using scp. I wrote a script to copy single file to NAS server.

#!/bin/bash
DATE=$(date +%Y%m%d_%H_%M_%S)
mv Camera1.avi Camera1_$DATE.avi
scp Camera1_$DATE.avi root@192.168.1.4:/root/test/
mv Camera1_$DATE.avi Camera1.av

But I have to write c program for copying multiple avi files with Date and Time to NAS server.

View 5 Replies View Related

Programming :: Shared Libs - Multiple Files In C++?

Oct 20, 2010

I'm trying to change a group of cpp files to one shared lib. I have created a shared lib with a single file. I then did this with a group of files. The difference in what I'm doing is that before with the single file, .a, was added into a single .o file. Now I'm trying to add it to my main.cpp file which is NOT a .o file. I'm now getting these compiler errors from the main.cpp where is doesn't seem to recognize the semaphores.Example Error: undefined reference to `sem_wait'If I were not to use the share libs this compiles and runs as I expected it to.Something tells me this is a compiler flag issue, at least I hope it is

View 1 Replies View Related

Programming :: Replace Whitespaces With Dots "." On All Files In Folder?

Nov 9, 2010

I have a lot of .avi,.mkv,.srt files with empty spaces that needs to be filled out with a dot "."

Example:

With space = "my movie file here.avi"
Replaced with dots = "my.movie.file.here.avi"

View 7 Replies View Related







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