Sponsored Content
Top Forums Shell Programming and Scripting Script to parse bookmarks file Post 302894919 by ozgadgetguy on Friday 28th of March 2014 12:56:21 AM
Old 03-28-2014
Script to parse bookmarks file

I am using Internet Explorer v10 at work and regularly need to import my personal Firefox bookmarks over. Long story short, I have found the import falling over on any bookmark elements which are over 256 characters.

The bookmark file contains bookmarks of this format:

<DT><A HREF="http://www.lasoo.com.au/" ADD_DATE="1394006093" LAST_MODIFIED="1394006093">bookmark text is here</A>

If the text from HREF onwards, up to but not including the “<” of the “</A>” is great than 255 characters then the import fails.

Can anyone suggest a script which can identify the offending lines so I can manually edit them?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help!!! Shell script to parse data file.

I am faced with a :confused: tricky problem to parse a data file ( May not be a tricky problem to the scripting guru's ). Here is what I am faced with. I have a file with multiple rows of data and the rows are not of fixed length. "|" is used as a delimiters for individual columns and each row... (3 Replies)
Discussion started by: yajaykumar
3 Replies

2. Shell Programming and Scripting

Parse file and copy value to variable in sh script.

Hi, I need to parse a simple text file like below and store the word that starts with BR* to a variable say $BRno. I need to do this in sh script. NOTE: the length of the numbers following BR is not constant (eg: it could be BR1234 or BR22233). And there is only 1 BRxxxxx in a file at a given... (6 Replies)
Discussion started by: script2010
6 Replies

3. Shell Programming and Scripting

Bash Shell Script to parse file

Raw Results: results|192.168.2|192.168.2.1|general/udp|10287|Security Note|For your information, here is the traceroute from 192.168.2.24 to 192.168.2.1 : \n192.168.2.24\n192.168.2.1\n\n results|192.168.2|192.168.2.1|ssh (22/tcp)|22964|Security Note|An SSH server is running on this port.\n... (2 Replies)
Discussion started by: jroberson
2 Replies

4. Shell Programming and Scripting

Script to parse a file faster

My example file is as given below: conn=1 uid=oracle conn=2 uid=db2 conn=3 uid=oracle conn=4 uid=hash conn=5 uid=skher conn=6 uid=oracle conn=7 uid=mpalkar conn=8 uid=anarke conn=1 op=-1 msgId=-1 - fd=104 slot=104 LDAPS connection from 10.10.5.6 to 10.18.6.5 conn=2 op=-1 msgId=-1 -... (7 Replies)
Discussion started by: sags007_99
7 Replies

5. UNIX for Dummies Questions & Answers

Help to parse csv file with shell script

Hello ! I am very aware that this is not the first time this question is asked here, because I have already read a lot of previous answers, but none of them worked, so... As said in the title, I want to read a csv file with a bash script. Here is a sample of the file: ... (4 Replies)
Discussion started by: Grhyll
4 Replies

6. Shell Programming and Scripting

script to parse the properties file

Hi Friends, I have a requirement to parse a properties file having a key=value pairs. i need to count the number of key value pairs in the properties file and iterate through each key-value pair. I have written the script to read the number of lines from the property file, but cannot... (2 Replies)
Discussion started by: prashdeep
2 Replies

7. Shell Programming and Scripting

AWK script to parse a data in a file

Hi Unix gurus.. I have a file which has below data, It has several MQ Queue statistics; QueueName= 'TEST1' CreateDate= '2009-10-30' CreateTime= '13.45.40' QueueType= Predefined QueueDefinitionType= Local QMinDepth= 0 QMaxDepth= 0 QueueName= 'TEST2' CreateDate= '2009-10-30'... (6 Replies)
Discussion started by: dd_psg
6 Replies

8. Shell Programming and Scripting

Script to test bookmarks

Does anyone have a script to test for invalid bookmarks? I have a ton of them and I'd bet that a good percentage could be dropped. Tnx (4 Replies)
Discussion started by: ongoto
4 Replies

9. Shell Programming and Scripting

Script parse file Linux

Hi all, I need help for a script that pulls out a series of numbers from a file (attached file) Basically I need a parse to write me in a variable: 9d424312 Can someone help me? Thank you (2 Replies)
Discussion started by: gianvitolinuxs
2 Replies

10. Homework & Coursework Questions

Script parse file

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Hi all, I need help for a script that pulls out a series of numbers from a file (attached file) Basically I... (1 Reply)
Discussion started by: gianvitolinuxs
1 Replies
SURFRAW(1)						      General Commands Manual							SURFRAW(1)

NAME
surfraw - a fast unix command line interface to WWW services SYNOPSIS
surfraw elviname [options] search words ... sr elviname [options] search words ... sr -elvi sr bookmark DESCRIPTION
Surfraw provides a fast unix command line interface to a variety of popular WWW search engines and other artifacts of power. It reclaims google, altavista, dejanews, freshmeat, research index, slashdot and many others from the false-prophet, pox-infested heathen lands of html-forms, placing these wonders where they belong, deep in unix heartland, as god loving extensions to the shell. Surfraw consists of a collection of elvi, each of which knows how to search a specific web site. To see the list of elvi type: surfraw -elvi Note that sr is an alias for surfraw, so that could equally be sr -elvi To search using an elvis use: sr elviname [options] search terms.. For example, to search google for information on Debian ports, using the "I'm feeling lucky" option: sr google -l debian ports Adding the elvi to your path If you are a regular user of surfraw, you will probably get sick of typing sr or surfraw each time. You can regain the old behaviour of running the elvi directly by adding the elvi directory (/usr/lib/surfraw) to your path, either manually or using surfraw-update-path(1). Bookmarks Surfraw supports bookmarks. To add a bookmark, add it to /etc/xdg/surfraw/bookmarks or $HOME/.config/surfraw/bookmarks The format of the bookmarks file is simple, each bookmark is on a separate line, with the bookmark and URL separated by whitespace, eg: ntk http://www.ntk.net/ To invoke a bookmark, use "surfraw bookmark" or "sr bookmark", and if an elvis of that name doesn't exist, it searches for a bookmark of that name instead. There are some example bookmarks in /etc/xdg/surfraw/bookmarks OPTIONS
Use sr elviname -local-help for elvi-specific options. The following options work with all elvi. -help Show summary of options (including elvi-specific options). -local-help Show elvi-specific options. -version Show version of program. -browser=EXECUTABLE Set browser (default: sensible-browser). -elvi Display a list of other Surfraw mechanisms for conquering evil. -escape-url-args=yes|no Apply url escaping to arguments (default: yes) -q|-quote Bracket all arguments with " characters (default: no). Note that putting quotes round arguments works now, so you can do, for exam- ple: sr google foo "bar baz" bam and the quoting is passed on to the search engine EXAMPLES
$ sr ask why is jeeves gay? $ surfraw google -results=100 RMS, GNU, which is sinner, which is sin? $ sr austlii -method=phrase dog like $ /usr/lib/surfraw/rhyme -method=perfect Julian CONFIGURATION
Surfraw uses the XDG basedir spec (http://standards.freedesktop.org/basedir-spec/basedir-spec-0.6.html) to locate config files. The default locations are shown below, but can be modified by setting the environment variables $XDG_CONFIG_HOME and $XDG_CONFIG_DIRS. See the spec for more details. Surfraw gets its configuration from three sources, in order: 1. Environment variables 2. /etc/xdg/surfraw/conf 3. $HOME/.config/surfraw/conf /etc/xdg/surfraw.conf and $HOME/.config/surfraw/conf are both fragments of bourne-shell style shell script. /etc/xdg/surfraw.conf should use def and defyn to define variables. These functions set variables unless they are already set by the envi- ronment. defyn is used for boolean configuration variables, def for all others. For instance: def SURFRAW_text_browser /usr/bin/lynx defyn SURFRAW_graphical no $HOME/.config/surfraw/conf should use sh-style entries, eg: SURFRAW_text_browser=/usr/bin/lynx SURFRAW_graphical=no This is because you want them to override environment variables unconditionally. CONFIGURATION VARIABLES
SURFRAW_global_conf Location of global configuration file. Default: def SURFRAW_global_conf /etc/xdg/surfraw/conf SURFRAW_conf Location of per-user configuration file. Default: def SURFRAW_conf $HOME/.config/surfraw/conf SURFRAW_graphical Whether to use a graphical browser. Default: defyn SURFRAW_graphical no SURFRAW_text_browser Name/path of text browser executable. e.g. links, lynx, w3m Default: def SURFRAW_text_browser sensible-browser SURFRAW_graphical_browser Name/path of graphical browser executable. e.g mozilla, netscape etc. Default: def SURFRAW_graphical_browser sensible-browser SURFRAW_text_browser_args Text browser arguments, or "none". Default: def SURFRAW_text_browser_args none SURFRAW_graphical_browser_args Graphical browser arguments, or "none". Default: def SURFRAW_graphical_browser_args none SURFRAW_graphical_remote Whether to use "-remote openURL" for graphical browser. Default: defyn SURFRAW_graphical_remote yes SURFRAW_new_window When using SURFRAW_graphical_remote, open a new window? Default: defyn SURFRAW_new_window no SURFRAW_screen Name of screen command to run. Default: def SURFRAW_screen screen SURFRAW_new_screen If surfraw is running under screen(1), start a new screen for each text browser invocation? Default: defyn SURFRAW_new_screen no SURFRAW_screen_args Arguments to pass to the SURFRAW_screen command Default: def SURFRAW_screen_args "" SURFRAW_quote_args Whether to "quote" all the arguments. Default: defyn SURFRAW_quote_args no SURFRAW_quote_ifs Whether to re-quote arguments if they have spaces in, ie so: sr google foo "bar baz" bam works as expected. Default: defyn SURFRAW_quote_ifs yes SURFRAW_results Default number of results to return (not supported by all elvi). Default: def SURFRAW_results 30 SURFRAW_escape_url_args Whether to escape [% "$%&+,/:;<=>?@[{|}~'] characters in command line arguments subsequently used to construct a url. Default: defyn SURFRAW_escape_url_args yes FILES
/usr/lib/surfraw Location of the elvi. ${HOME}/.config/surfraw/elvi Per-user elvi. /etc/xdg/surfraw/conf Default system wide configuration file. $HOME/.config/surfraw/conf Default per-user config file /etc/xdg/surfraw/bookmarks System wide bookmarks file. $HOME/.config/surfraw/bookmarks Per-user bookmarks file. BUGS
Please report any bugs found (or any web sites in need of surfrawizing) either via the debian bug tracking system (http://bugs.debian.org/) or to the surfraw-devel list (surfraw-devel@lists.alioth.debian.org). SEE ALSO
http://alioth.debian.org/projects/surfraw/ PROPAGANDA
Oh Baybe I need some Deep Linking Let us go Surfin' in the raw! Read HACKING. Surfrawize the soul of your favourite internet wonder. Join the Shell Users' Revolutionary Front Against the WWW by submit- ting code. Reclaim heathen lands. Bear witness to the truth. Its love will set you free. Join us on surfraw-devel@lists.alioth.debian.org AUTHORS
Originally written by Julian Assange. Now maintained by the surfraw-devel team <surfraw-devel@lists.alioth.debian.org>. See the file AUTHORS for the full list of contributors. Man page by Ian Beckwith, based on the original README and an earlier man page by Christian Surchi. COPYRIGHT
Copyright (c) 2003-2008 The Surfraw-Devel Team <surfraw-devel@lists.alioth.debian.org> Copyright (c) 2000-2001 Julian Assange <proff@iq.org> Copyright (c) 2001 Australian Institute for Collaborative Research Copyright (c) 2000 Melbourne Institute for Advanced Study The copyright holders listed above assert no rights on this release of the software ``surfraw'' and thereby explicity place this release into the into the public domain. Do what you will. Feb 03, 2004 SURFRAW(1)
All times are GMT -4. The time now is 03:21 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy