03-09-2013
Need help with these scripts in nano...
So I am trying to write 3 different scripts using nano. Having some trouble with each.
The first one is prompting for the person's information, and I would like to store that information in a new text file. I have most of it complete. The only problem I have here is that I do not know the code to send all of the information to the new text file.
The second one I want to remove all HTML tags from a document, as well as duplicate lines.
The third script I have a list of states, their land area and population. I need it to ask the person if they would like to have a new file sorted alphabetically by state name, by land area or by population. They can choose 1, 2, or 3. Depending on what they choose, I need to output their choice to a new text file.
I sort of have a grasp on what to do for these scripts but I need a little help on each one. Any help would be appreciated.
6 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all,
I have this problem. I am running suse linux 10.0 Enterprise.
I was able to install nano-2.0.6 and as root I am able to use it.
This is where my problem starts.
When I exit root and try to use nano, I get this error message.
nano: Command not found.
but when I type... (3 Replies)
Discussion started by: goku3g
3 Replies
2. Linux
Dear all
I have problem in installing microwindows.
What I did
1.I have microwindows-0.90 in home/SHIVA
2.cd microwindows-0.90/src
3.cp configs config
4.make clean; make
5. make
6.now it is giving error :-
winevent.c:18: error: static declaration of ‘abs' follows non-static declaration... (0 Replies)
Discussion started by: mishra_sk_in
0 Replies
3. HP-UX
How to isntall nano on HP UX?
Thanks:eek: (1 Reply)
Discussion started by: ldaliosmane
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I am working on a project to develop an embedded device that can transfer files between two usb devices ( pen drives). We are using an NUC950A ARM9 microcontroller and we've put the Linux 2.1 kernel on the development board and it works. Can i use nano -x to design my own GUI so that i can run... (3 Replies)
Discussion started by: dilumcc
3 Replies
5. Shell Programming and Scripting
p { margin-bottom: 0.08in; } As you can already tell I am a newbie. I took a Microsoft VB2008 a few month back. Now I'm taking Linux + and this course requires me to write scripts. The script executes but, I can't figure out or have not found anything that I can make out on the internet that can... (4 Replies)
Discussion started by: SANA4SPA
4 Replies
6. Shell Programming and Scripting
I need to switch files in a directory using Nano thinking i have all the files in the same directory? how would i go about doing that ? (2 Replies)
Discussion started by: JuankyKong
2 Replies
LEARN ABOUT CENTOS
html::filter
HTML::Filter(3) User Contributed Perl Documentation HTML::Filter(3)
NAME
HTML::Filter - Filter HTML text through the parser
NOTE
This module is deprecated. The "HTML::Parser" now provides the functionally of "HTML::Filter" much more efficiently with the the "default"
handler.
SYNOPSIS
require HTML::Filter;
$p = HTML::Filter->new->parse_file("index.html");
DESCRIPTION
"HTML::Filter" is an HTML parser that by default prints the original text of each HTML element (a slow version of cat(1) basically). The
callback methods may be overridden to modify the filtering for some HTML elements and you can override output() method which is called to
print the HTML text.
"HTML::Filter" is a subclass of "HTML::Parser". This means that the document should be given to the parser by calling the $p->parse() or
$p->parse_file() methods.
EXAMPLES
The first example is a filter that will remove all comments from an HTML file. This is achieved by simply overriding the comment method to
do nothing.
package CommentStripper;
require HTML::Filter;
@ISA=qw(HTML::Filter);
sub comment { } # ignore comments
The second example shows a filter that will remove any <TABLE>s found in the HTML file. We specialize the start() and end() methods to
count table tags and then make output not happen when inside a table.
package TableStripper;
require HTML::Filter;
@ISA=qw(HTML::Filter);
sub start
{
my $self = shift;
$self->{table_seen}++ if $_[0] eq "table";
$self->SUPER::start(@_);
}
sub end
{
my $self = shift;
$self->SUPER::end(@_);
$self->{table_seen}-- if $_[0] eq "table";
}
sub output
{
my $self = shift;
unless ($self->{table_seen}) {
$self->SUPER::output(@_);
}
}
If you want to collect the parsed text internally you might want to do something like this:
package FilterIntoString;
require HTML::Filter;
@ISA=qw(HTML::Filter);
sub output { push(@{$_[0]->{fhtml}}, $_[1]) }
sub filtered_html { join("", @{$_[0]->{fhtml}}) }
SEE ALSO
HTML::Parser
COPYRIGHT
Copyright 1997-1999 Gisle Aas.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.16.3 2013-03-25 HTML::Filter(3)