Sponsored Content
Full Discussion: Parsing problem
Top Forums Shell Programming and Scripting Parsing problem Post 302185972 by joeyg on Wednesday 16th of April 2008 07:58:32 AM
Old 04-16-2008
Question Parse to do what?

Parse a string == analyze characters

So, given:
"xyz","1233","cm_asdfasdf"

what are you trying to figure out?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

parsing problem with script

I'm trying to parse the variables out of a comma delimited expression, but i'm having trouble with script: num_var=1 while do a=`echo "a=7, b=8, c=9" | awk '{print $num_var}' | cut -d= -f2` b=`echo $a | cut -d, -f1` echo $b num_var=`expr $num_var + 1`... (5 Replies)
Discussion started by: mike@freddiemac
5 Replies

2. Shell Programming and Scripting

awk parsing problem

I need help with a problem that I have not been able to figure out. I have a file that is about 650K lines. Records are seperated by blank lines, fields seperated by new lines. I was trying to make a report that would add up 2 fields and associate them with a CP. example output would be... (11 Replies)
Discussion started by: timj123
11 Replies

3. Shell Programming and Scripting

Parsing problem

I need to separate out the contents in the string "xyz","1233","cm_asdfasdf" as xyz,1233,cm_asdfasdf Can anyone help me on this?? (1 Reply)
Discussion started by: Sushir03
1 Replies

4. Shell Programming and Scripting

Parsing problem

I need to parse a string which looks like "xyx","sdfsdf","asf_asdf" into var1="xyx" var2="sdfsdf" var3="asf_asdf" (3 Replies)
Discussion started by: Sushir03
3 Replies

5. Shell Programming and Scripting

Parsing textfile problem with cut

Hi, I have a textfile with several lines like this: text num: USER text (num) num num I need all these stuff. Problem is, how to get these stuff after ":". USER is a username and all chars are possible, even whitespace. So I cant use cut. Any ideas? (3 Replies)
Discussion started by: mcW
3 Replies

6. Shell Programming and Scripting

Parsing Problem

Hi all, I am having problems parsing the following file: cat mylist one,two,three four five,six My goal is to get each number on a seperate line. one two three four five six I tried this command: sed -e 's/\,/^M/g' mylist (11 Replies)
Discussion started by: rob11g
11 Replies

7. Shell Programming and Scripting

Parsing problem

Hello, I have a similar problem so I continue this thread. I have: my_script_to_format_nicely_bdf.sh | grep "RawData" |tr -s ' '|cut -d' ' -f 4|tr -d '%' So it supposed to return the percentage used of RawData FS: 80 (Want to use it in a alert script) However I also have a RawData2 FS so... (17 Replies)
Discussion started by: drbiloukos
17 Replies

8. Shell Programming and Scripting

Problem parsing args

Heya Tooltip: Parsing (getopts) for -u successfully sets mode=umnt, but case umnt is not executed, instead it either executes/show help or regular mount screen. I had copy pasted the structure of a getopts 'structure' from Man Page for getopts (posix Section 1) - The UNIX and Linux Forums... (1 Reply)
Discussion started by: sea
1 Replies

9. Shell Programming and Scripting

Problem parsing

Hi, I want to fetch a text.Clipping. ... (5 Replies)
Discussion started by: protocomm
5 Replies

10. Shell Programming and Scripting

awk parsing problem

Hello fellow unix geeks, I am having a small dilemna trying to parse a log file I have. Below is a sample of what it will look like: MY_TOKEN1(group) TOKEN(other)|SSID1 MY_TOKEN2(group, group2)|SSID2 What I need to do is only keep the MY_TOKEN pieces and where there are multiple... (7 Replies)
Discussion started by: dagamier
7 Replies
GraphViz::Parse::RecDescent(3pm)			User Contributed Perl Documentation			  GraphViz::Parse::RecDescent(3pm)

NAME
GraphViz::Parse::RecDescent - Visualise grammars SYNOPSIS
use GraphViz::Parse::RecDescent; # Either pass in the grammar my $graph = GraphViz::Parse::RecDescent->new($grammar); print $g->as_png; # or a Parse::RecDescent parser object my $graph = GraphViz::Parse::RecDescent->new($parser); print $g->as_ps; DESCRIPTION
This module makes it easy to visualise Parse::RecDescent grammars. Writing Parse::RecDescent grammars is tricky at the best of times, and grammars almost always evolve in ways unforseen at the start. This module aims to visualise a grammar as a graph in order to make the structure clear and aid in understanding the grammar. Rules are represented as nodes, which have their name on the left of the node and their productions on the right of the node. The subrules present in the productions are represented by edges to the subrule nodes. Thus, every node (rule) should be connected to the graph - otherwise a rule is not part of the grammar. This uses the GraphViz module to draw the graph. Thanks to Damian Conway for the idea. Note that the Parse::RecDescent module should be installed. METHODS
new This is the constructor. It takes one mandatory argument, which can either be the grammar text or a Parse::RecDescent parser object of the grammar to be visualised. A GraphViz object is returned. # Either pass in the grammar my $graph = GraphViz::Parse::RecDescent->new($grammar); # or a Parse::RecDescent parser object my $graph = GraphViz::Parse::RecDescent->new($parser); as_* The grammar can be visualised in a number of different graphical formats. Methods include as_ps, as_hpgl, as_pcl, as_mif, as_pic, as_gd, as_gd2, as_gif, as_jpeg, as_png, as_wbmp, as_ismap, as_imap, as_vrml, as_vtx, as_mp, as_fig, as_svg. See the GraphViz documentation for more information. The two most common methods are: # Print out a PNG-format file print $g->as_png; # Print out a PostScript-format file print $g->as_ps; BUGS
Translating the grammar to a graph is accomplished by peeking inside the internals of a parser object, which is a tad scary. A new version of Parse::RecDescent with different internals may break this module. At the moment, almost all Parse::RecDescent directives are supported. If you find one that has been missed - let me know! Unfortunately, alternations (such as the following) do not produce very pretty graphs, due to the fact that they are implicit (unamed) rules and are implemented by new long-named subrules. character: 'the' ( good | bad | ugly ) /dude/ Hopefully Parse::FastDescent will make this all much easier. AUTHOR
Leon Brocard <acme@astray.com> COPYRIGHT
Copyright (C) 2001, Leon Brocard This module is free software; you can redistribute it or modify it under the same terms as Perl itself. perl v5.14.2 2012-04-02 GraphViz::Parse::RecDescent(3pm)
All times are GMT -4. The time now is 07:01 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy