Sponsored Content
Full Discussion: Text Parser
Top Forums Shell Programming and Scripting Text Parser Post 302187771 by krishmaths on Tuesday 22nd of April 2008 03:01:40 AM
Old 04-22-2008
Remove the extra space after the IP address ($4=="xxx.xxx.xxx.xxx " ) in the awk command.

It works perfectly fine.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

string parser

I am new to scripting I want to parse a string in a loop eg A:B:C:D E:F:G:H and put them in different variable attr1 = A attr2 = B attr3 = C attr4 = D . . /* do processing with attr1, attr2, attr3 and attr4 */ then go to next line E:F:G:H and again assign... (8 Replies)
Discussion started by: flextronics
8 Replies

2. Shell Programming and Scripting

Help with an (easy) parser

Hello, i'm workig with a file with structural information about biological macromolecules (proteins etc). In a certain file, the info is structured like this @<TRIPOS>MOLECULE blah 1 blah 2 blah 3 @<TRIPOS>MOLECULE foo 1 foo 2 foo 3 @<TRIPOS>MOLECULE mmm 1 mmm 2 mmm 3 I would... (7 Replies)
Discussion started by: aristegui
7 Replies

3. Shell Programming and Scripting

need a text parser

i need a simple text parser which can parse a data file created by a softwre so that i can export it to my mysqldb,, datafile created as one record per line with different number of fields. e.g datafile contains following. a=1, b=3, c=4 a=1, c=55, d=abcd a=5, b=hello, c=99, d=help now i... (12 Replies)
Discussion started by: sfaizan
12 Replies

4. Shell Programming and Scripting

Incremental log parser

I have log file that is incremented every second and is rather big. I need monitor error in this file. I do not want to parse it all every time. I want parse it first time then remember last position (as byte for example) All consequent parsing I want to start from last saved position to the... (3 Replies)
Discussion started by: Narcom
3 Replies

5. Shell Programming and Scripting

Parser with sed

Hi, I have this variable: <a href="http://www.rtve.es/mediateca/videos/20100916/video-calamares-rellenos-salsa-pimientos-garbanzos-16-09-10/878586.shtml">V�deo: Calamares rellenos con salsa de pimientos y ...</a> I would like to have: ... (7 Replies)
Discussion started by: mierdatuti
7 Replies

6. Programming

Parser

Hi Everyone I have an out put of multiple lines which I would like to parse and retrieve certain info from it. The output consists of multiple sections that starts with the line Client: and ends with STL tag: each section separated by an empty line. So basically somehting like Client: ... (10 Replies)
Discussion started by: bombcan1
10 Replies

7. Shell Programming and Scripting

File Parser

Hi need help parsing a file. I have tag fields and values in a file with delimiter |. sample records from the file listed below 8=value|9=value|35=value|49=value|56=value|34=value|50=value|48=value|10=value 8=value|9=value|35=value|49=value|56=value|34=value|51=value|48=value|10=value... (2 Replies)
Discussion started by: subramanian
2 Replies

8. Shell Programming and Scripting

SQL Parser

Hi, I have been assigned a task to migrate few thousands of sql scripts to a different db format. there could be sub queries and complex joins. there would be functions that needs to be replaced from a given list to another values. this should also parse the sub\inline queries. Can you please... (1 Reply)
Discussion started by: hitmansilentass
1 Replies

9. Shell Programming and Scripting

Parser

Hi All, I am trying to create a parser to find out what cobol programs are being called by which JCL's. I need to search recursively until the main cobol program is found being called by a JCL. I tried to create a script but I am not able to generalize it. Can someone please help. ... (1 Reply)
Discussion started by: nua7
1 Replies

10. UNIX for Beginners Questions & Answers

Making a parser

input 1..100km 112..403km 500..623km required output 1..51 112..162 500..550 (i.e 50kms added to the initial distance) (2 Replies)
Discussion started by: ANKIT ROY
2 Replies
Graph::Easy::Parser::VCG(3pm)				User Contributed Perl Documentation			     Graph::Easy::Parser::VCG(3pm)

NAME
Graph::Easy::Parser::VCG - Parse VCG or GDL text into Graph::Easy SYNOPSIS
# creating a graph from a textual description use Graph::Easy::Parser::VCG; my $parser = Graph::Easy::Parser::VCG->new(); my $graph = $parser->from_text( "graph: { " . " node: { title: "Bonn" } " . " node: { title: "Berlin" } " . " edge: { sourcename: "Bonn" targetname: "Berlin" } " . "} " ); print $graph->as_ascii(); print $parser->from_file('mygraph.vcg')->as_ascii(); DESCRIPTION
"Graph::Easy::Parser::VCG" parses the text format from the VCG or GDL (Graph Description Language) use by tools like GCC and AiSee, and constructs a "Graph::Easy" object from it. The resulting object can then be used to layout and output the graph in various formats. Output The output will be a Graph::Easy object (unless overrriden with "use_class()"), see the documentation for Graph::Easy what you can do with it. Attributes Attributes will be remapped to the proper Graph::Easy attribute names and values, as much as possible. Anything else will be converted to custom attributes starting with "x-vcg-". So "dirty_edge_labels: yes" will become "x-vcg-dirty_edge_labels: yes". METHODS
"Graph::Easy::Parser::VCG" supports the same methods as its parent class "Graph::Easy::Parser": new() use Graph::Easy::Parser::VCG; my $parser = Graph::Easy::Parser::VCG->new(); Creates a new parser object. There are two valid parameters: debug fatal_errors Both take either a false or a true value. my $parser = Graph::Easy::Parser::VCG->new( debug => 1 ); $parser->from_text('graph: { }'); reset() $parser->reset(); Reset the status of the parser, clear errors etc. Automatically called when you call any of the "from_XXX()" methods below. use_class() $parser->use_class('node', 'Graph::Easy::MyNode'); Override the class to be used to constructs objects while parsing. See Graph::Easy::Parser for further information. from_text() my $graph = $parser->from_text( $text ); Create a Graph::Easy object from the textual description in $text. Returns undef for error, you can find out what the error was with error(). This method will reset any previous error, and thus the $parser object can be re-used to parse different texts by just calling "from_text()" multiple times. from_file() my $graph = $parser->from_file( $filename ); my $graph = Graph::Easy::Parser::VCG->from_file( $filename ); Creates a Graph::Easy object from the textual description in the file $filename. The second calling style will create a temporary parser object, parse the file and return the resulting "Graph::Easy" object. Returns undef for error, you can find out what the error was with error() when using the first calling style. error() my $error = $parser->error(); Returns the last error, or the empty string if no error occured. parse_error() $parser->parse_error( $msg_nr, @params); Sets an error message from a message number and replaces embedded templates like "##param1##" with the passed parameters. CAVEATS
The parser has problems with the following things: attributes Some attributes are not remapped properly to what Graph::Easy expects, thus losing information, either because Graph::Easy doesn't support this feature yet, or because the mapping is incomplete. comments Comments written in the source code itself are discarded. If you want to have comments on the graph, clusters, nodes or edges, use the attribute "comment". These are correctly read in and stored, and then output into the different formats, too. EXPORT
Exports nothing. SEE ALSO
Graph::Easy, Graph::Write::VCG. AUTHOR
Copyright (C) 2005 - 2008 by Tels <http://bloodgate.com> See the LICENSE file for information. perl v5.14.2 2011-12-23 Graph::Easy::Parser::VCG(3pm)
All times are GMT -4. The time now is 03:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy