Programming :: Pull Http Links Out Of Text Files?

Aug 15, 2010

I am trying to figure out a way to pull http links out of text files and then output the results in a log. The text files are in folders like this inside a source directory.

/source
./folder1
...folder1.txt
./folder2
...folder1.txt

[Code]....

View 4 Replies


ADVERTISEMENT

Programming :: Script To Pull Files From Windows?

Jul 2, 2010

I have a script in Linux that generates a report on my Linux machine. I would like to know if there is anyway I can write a script to pull this report automatically from my Linux machine into my windows machine. Both Linux and Windows machines are on the same network

View 1 Replies View Related

Programming :: Replacing Text With A Http Link With Sed?

Dec 10, 2010

Been at this all morning and fail on every attempt.

I have a file called sitemapindex.xml

Its contents just are names of the other sitemaps. Google gets pissy because it isn't in a http:// format.

So, I need "<loc>sitemap-c1mediawiki-............</loc>" to be replaced with "<loc>http://domain.tld/sitemap-c1mediawiki-............</loc>".

Here's the expression I've been trying:

find /path/to/site/sitemap-index-c1mediawiki* -type f | xargs sed -i 's/[<loc>sitemap]/[<loc>http://domain.tld/]/'

It fails.

I've tried with and without brackets.

View 4 Replies View Related

Programming :: Scripting : Change Markdown Links To Wikitext Links?

Feb 3, 2009

I have a personal wiki of notes, with now thousands of links in markdown format:

[link text](http://example.com)

but now that fckeditor is available for mediawiki (very beta), it has become much better to just stick with wikitext format. There are only a few conversions to do: tables, links, and bulleted lists. The lists are a fairly simple regex and fckeditor magically reformats the tables, so all I'm left with is the links. But I'm not a regex master. How do I reformat code...

View 12 Replies View Related

Red Hat / Fedora :: HTTP Links In Thunderbird Doesn't Work

Jun 29, 2011

after updating to fedora 15, the http links in Thunderbird doesn't work.I have tried many solutions, but without result.
- in prefs.js add :user_pref("network.protocol-handler.app.ftp", "/usr/bin/firefox");
user_pref("network.protocol-handler.app.http", "/usr/bin/firefox");
user_pref("network.protocol-handler.app.https", "/usr/bin/firefox");- I have tried it with KDE and GNOME.
- move .thunderbird to .thunderbird.backup and reopen thunderbird. But still same problem.
- When I create a new user it works correctly! So I think it must be related to the update.
- I also change the default application (in System Settings) to google-chrome and Opera. But no result.
- http-links in other application (dolphin, nautilus, ...) works correctly

View 1 Replies View Related

Ubuntu :: Thunderbird Won't Open Http Links In Browser / Only Https

Apr 30, 2010

When I click on an http link in Thunderbird, nothing at all happens. There's no error message on the console, there's no new browser starting, and there's no new tab opening with the browser already running.

I've tried: sudo update-alternatives --config x-www-browser, choosing firefox.I've also tried: adding a new string value to Thunderbird's warranty-voiding config: network.protocol-handler.app.http, with a value of /usr/bin/firefox. This was recommended in various threads.But no luck.There's an entry for https - firefox on the Attachment tab of the preferences, and https links are indeed opening in Firefox. But not http.KDE 4.4.2 itself has default mail client and browser set to Thunderbird 3.0.4 and Firefox 3.6.3 (both from the repositories, no website downloads).

View 3 Replies View Related

Debian Multimedia :: HTTP Links In Email On Icedove Don't Open In Icewease Using LXD

Nov 24, 2010

http links in email on Icedove don't open in Icewease using LXDE:

network.protocol-handler.app.http & network.protocol-handler.app.https are both set to the default x-www-browser, which is pointed to icedove but nothing happens, any suggestions?

View 3 Replies View Related

Ubuntu Networking :: Can't View External IP Links To Http Server On Same Machine

Sep 1, 2011

I have an apache server running on my ubuntu machine. I can view them using my local ip (192.168.1.6):80/. And my friends can view the things hosted on my server using my external ip (example http://123.123.123.123:80) but when a friend links back to me to show me what they are looking at and share the moment, I can't view the link, it simply redirects to my router login page.

I had an older linksys router and this could work fine. I could click on the links with my external IP and it routes back to my server for viewing.

Remember to note that I am on the machine that has the server, and I'd like to be redirected out and back to it so we can share pictures back and fourth without me having to replace the external IP address with my local one just to view that link in the browser.

View 3 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 :: Pull The IPs One By One From The File And Then Ban?

May 4, 2010

Code:
#!/bin/sh
egrep -o 'SRC=[[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3}.[[:digit:]]{1,3}' /var/log/messages | sed 's/SRC=//g' | sort | uniq > /badips.txt

[Code]....

how do i pull the IPs one by one from the file and then ban?

View 1 Replies View Related

Programming :: Extract The Text From Files?

Aug 28, 2010

I have many files in a folder from which I need to extract some contents, these are basically text files wich have individual lines with (i.e)

name: john
address: whatever
phone: 123456

Some caveats

1. Sometimes a line might be missing.

name: johnn
phone: 123456

2. Lines are not in the same line-numbers across the files I did try some things with awk based on google searches but I couldn't extract the data of each file into a single line (this is the ultimate goal):

john,whatever,123456

I don't have knowledge other than having put some bash scripts together for backup jobs, so I am open to install anything that could to pull this off.

View 14 Replies View Related

Programming :: Substitute Text In Many Files?

Mar 11, 2010

I have this PHP Program I have been hobbying for years. Started in old PHP3 early PHP4. So with the newer PHP, things are starting to break! I have this string:

session_is_registered('UserID')

And I need to convert to this:

isset($_SESSION['UserID'])

in more than 200 scripts in my directory. I have been toying with perl (in a copy of the dir of course in case I really screw things over, lol) but am not gettig too far. The new code needs to swap ( ) for [ ] and i'm just all hung up! I am getting lost in Perl, I have this, but it does not substitute so I am missing something:

perl -i.bak -pe "s/session_is_registered('UserID')/isset(\$_SESSION['UserID'])/g" *.php

View 7 Replies View Related

Programming :: Find Files With Missing Text?

Oct 19, 2010

Need to make sure a security line is added in to every webpage on a site, trying to find out how to list only the filenames of the pages that are missing the text. awk or grep? o what I want is to list all files NOT containing the word 'securemasthead'

View 2 Replies View Related

Programming :: Reading And Writing Text Files In C?

Jan 1, 2011

Reading and writing text files in C?

View 9 Replies View Related

Programming :: Play With Calling Text Files In C

May 5, 2010

I am trying to play with calling text files in C. What I have is a text file with 4 columns of numbers I need to average 2 of them. I have started and hit a wall. I have the following so far:

[Code]....

I still need to figure out how to read the data in. I have been reading on this for a few hours and its not clicking. How does the program know which columns with names to call. the data is organized: ID, Day, Speed, Temp.

View 6 Replies View Related

Programming :: Read Entire Text Files Into C++?

Sep 15, 2010

im making a program (for the heck of it) that rewrites it code everytime it is run.(my ambition is to turn it into my c++ teacher and watch her be confuzled as to why she cant read my code and why it does weird things) Ive just started c++ programming, and managed to rewrite a program so that when it is run a second time, it says hello world. My problem is that I can only input the file as a single string. What I need to do is to be able to input the entire file into the c++ program, as a single object and then ifstream it out with the destination as the source code.

Also, it would help alot if there was someway to write additional lines to an existing text file instead of overwriting what is already there. That way, every time my c++ runs and rebuilds itself, it adds another couple of lines of code to a txt file and when the final iteration is complete, it loads a text file that was created by the program and uses it to program itself. I heard there is some sort of spawn command, can it be used to open up notepad and write to it? it would be awsome if my various programs could open different notepads with various messages

View 2 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 :: How To Pull Node Pointers Out Of The Model

Mar 25, 2010

I am trying to find a way to pull Node Pointers out of the model, for use in other areas of the program. The solution is probably simple but I haven't had any luck finding it.

Model for a QTreeView:

Code:

class testModel : public QAbstractItemModel
{
public:
testModel();
~testModel();

[code]....

View 2 Replies View Related

Programming :: Unable To Pull And Store Certificates?

Dec 21, 2009

I have to pull certificate from multiple computers which are on network and store it in a single fie or each file belong to a particular computer.I am using certutil -store to import the certificate.

View 4 Replies View Related

Ubuntu :: Mounting DD Image To Pull Off Individual Files?

Mar 29, 2010

I have a gziped dd image backup of my entire hda drive (osx and ext4 partitions) that I created with the following command:
dd if=/dev/sda |gzip > image032810.gz
Can I mount this image file to pull off individual files from individual partitions?

View 6 Replies View Related

General :: Compare Files And Pull Out Required Data?

Nov 10, 2010

I have 2 files to compare and then print out information that match a certain pattern. I know basic scripting and was heading down the path of merging the 2 files together but this is the wrong approach. Would really appreciate a script that can do what is required:

file 1 contains dates, times and ID's:
2010-10-28 10:42 5939697357
2010-10-28 11:56 5919543491

[code]...

View 4 Replies View Related

Programming :: Editing Text Files With Information From PostgreSQL DB?

May 16, 2011

Is there any way to edit text files with information in a database? The file is supposed to be always the same.. the information is going to be addedd in a specific format

View 2 Replies View Related

Programming :: Grep And Pull The IP Based On The Request String?

May 5, 2010

in the access logs i have this:

Code:
IP.IP.IP.IP - - [01/May/2010:11:21:10 -0400] "BIG STRING" 414 250
how can i grep and pull the IP based on the request string?

View 7 Replies View Related

General :: Remove All The <a Href Links From Text File?

Mar 24, 2010

[Code]....

I am trying to remove <a href links using SED but unable to do it.

The finale result I am looking for is

[Code]....

Is it possible with Linux or should I try with Php?

View 2 Replies View Related

Programming :: BASH Read Text List Zip Files Into A Single Archive?

Jul 22, 2010

AKA "zipping on the fly .. the slow-as-molasses way." The list includes full pathnames to each file, and they're all in subfolders of the same parent folder (which, unfortunately, is not the root folder of the drive or system on which the files reside). A cleaned-up and radio-ready portion of the list looks like

Quote:

.../taiga/ahqr-va-choyvp/bv0884-073.jpg
.../taiga/ahqr-va-choyvp/bv2635-073.jpg
.../taiga/ahqr-va-choyvp/bv3067-175.jpg

[code]....

What I'd like to be able to do is zip all the files in the list into a single archive, to avoid the step of having to copy them to the same location (presumably another folder on the HD) and then zip that folder. I'm more inclined to make provisions about extracting to a single folder at some other time. Is this possible in BASH, or would I have to consider a faster, more robust scripting language such as python or perl?

View 8 Replies View Related

Programming :: Creating A Ftp Script That Will Take Connection And File Details From Text Files?

Nov 23, 2010

I need a little help creating a ftp script that will take connection and file details from text files.For example:ftpscript.sh - script that looks for details and does transferftpparams.txt - ftp server connection details in single line csv formatftpfiles.txt - files that need to be transfer, one file per line.I have tried using awk with no success

View 2 Replies View Related

Programming :: Parsing Text Files In Bash / Cant Seem To Read The Array Back?

May 29, 2011

PI'm trying to write a script to list all open ports in the MINIUNPND chain in iptables and use the procotol, port and destination ip to open ports on another router using upnpc.Here is the output of iptables -L MINIUPNPD

Code:
>iptables -L MINIUPNPD
Chain MINIUPNPD (1 references)
target prot opt source destination
ACCEPT tcp -- anywhere 192.168.3.124 tcp dpt:19955
ACCEPT tcp -- anywhere 192.168.3.124 tcp dpt:20054
ACCEPT tcp -- anywhere 192.168.3.130 udp dpt:10654
ACCEPT tcp -- anywhere 192.168.3.121 tcp dpt:29955
code....

No matter what i do i cant seem to remove the first 4 characters from the MYPROT array to leave only the digits. Also i cant seem to read the array back???

I thought it would simply be a loop reading each line and passing the fields in variables, executing upnpc commands i need then moving to the next line of the file until it reached the EOF.

View 12 Replies View Related

Programming :: Sed Regular Expression - Write Script To Edit Text Files?

Jun 29, 2010

I am trying to write a script to edit text files formatted like this:

Code:
(MCAL@Contig766:0.30207,CGIG@CVIR_Contig1014:0.13977,(HASI@HDIS_Contig573:0.16828,(CAPI@LCIN_5594371:0.36581,CFOR@FQH745302RIQ7Y:1.91244)0.160:0.00019)0.939:0.15648);
There are never line breaks or spaces in the actual files.

I want to delete all instances of the character "@" and everything between it and the next "," (including that comma) or the next ")" (including that close parentheses) whichever comes first. My desired output file would be like this:

Code:
(MCAL,CGIG,(HASI,(CAPI,CFOR)0.160:0.00019)0.939:0.15648);
I figured out how to do this using sed for either "," or ")" but both looking for whichever comes first.

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







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