Sponsored Content
Full Discussion: Iterate column with perl
Top Forums Shell Programming and Scripting Iterate column with perl Post 302941254 by cmccabe on Tuesday 14th of April 2015 12:45:50 PM
Old 04-14-2015
$left is a defined set of 18 columns to the left

$right is a defined set of 8 columns to the right. Thank you Smilie.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

iterate sed over files

Greetings. I'm having a time of it with this file. I'm trying to do a script that will take two command line inputs, string1 and string2 and use sed to change the text over files in the current directory. This is what I have so far. It appears to work a little, it does create the... (3 Replies)
Discussion started by: rdanda
3 Replies

2. Shell Programming and Scripting

iterate over array

I can not for the life of me figure out how to iterate over this array { 'name1' => { 'a' => . 'b' => }, 'name2' => { 'a' => . 'b' => } } I want a for loop to iterate through the first element (name1 and name2 in my example) but I can't figure it out. Help... (2 Replies)
Discussion started by: IMTheNachoMan
2 Replies

3. Shell Programming and Scripting

Shell - How to iterate through all the files in a directory?

Hi, I have a directory call Test, which contains files "a", b", "c", etc. I want to go through all of the files inside Test and remove any empty file. How would I do that with shell csh? So far I got... #!/bin/csh if (($#argv == 0) || ($#argv > 1)) then echo "no argument or too... (2 Replies)
Discussion started by: teiji
2 Replies

4. Shell Programming and Scripting

Compare Two Files(Column By Column) In Perl or shell

Hi, I am writing a comparator script, which comapre two txt files(column by column) below are the precondition of this comparator 1)columns of file are not seperated Ex. file1.txt 8888812341181892 1243548895685687 8945896789897789 1111111111111111 file2.txt 9578956789567897... (2 Replies)
Discussion started by: kumar96877
2 Replies

5. Shell Programming and Scripting

script to iterate

Hi i need to find x in the following equation such that it satisfies this condition: y/x-ln(x)-1.24=0 how can i write a script to iterate to give random x to satisfy this equation. y is different each time too. any help with awk/shell script will be awesome! thanks (1 Reply)
Discussion started by: saint2006
1 Replies

6. Shell Programming and Scripting

Do loop doesn't iterate

I'm trying to send the file list as parameter to another job and execute it. But the loop doesn't work, the inner job is running only once and not twice as expected for filelist in $(ls -rt *.txt | tail -2) do echo $filelist export filelist cmd="$Program -config $configfile -autoexec... (11 Replies)
Discussion started by: asandy1234
11 Replies

7. Shell Programming and Scripting

Iterate array using loop over ssh

A simple script: #!/bin/bash test=test test1=(test1 test2 test3) echo ${test1 } ssh server 'echo '$test'; echo '${test1 }' ; echo '${test1}' ; for m in $(seq 1 $(echo '${test1 }' | tr " " "\n" | wc -l)); do echo $m ; echo '${test1}'; done'Here is the result: test1 test2 test3 testing... (5 Replies)
Discussion started by: mharald
5 Replies

8. UNIX for Beginners Questions & Answers

Script to iterate over several options

Have two 3 files which has list of servers,users and location and base url which is common on every server A = server1 server2 server3 B = user1 user2 user3 C = dom1 dom2 dom3 baseurl=/opt/SP/ and what i have to achieve is below via ssh from REMOTE SERVER for it's first iteration it... (7 Replies)
Discussion started by: abhaydas
7 Replies

9. Shell Programming and Scripting

Iterate over `dirs` in a bash script

I would like to iterate over `dirs`in a script, but the script will never show more than one (current) folder #! /bin/bash for i in `dirs` do echo ${i} done echo ++++++++++++++++++ for i in $( dirs -p ) do echo ${i} done echo ------------------ dirscontent=`dirs` echo... (5 Replies)
Discussion started by: alexanderb
5 Replies

10. UNIX for Beginners Questions & Answers

Iterate through a list - checking for a duplicate then report it ot

I have a job that produces a file of barcodes that gets added to every time the job runs I want to check the list to see if the barcode is already in the list and report it out if it is. (3 Replies)
Discussion started by: worky
3 Replies
gv(3python)															       gv(3python)

NAME
gv_python - graph manipulation in python SYNOPSIS
#!/usr/bin/python import gv USAGE
INTRODUCTION
gv_python is a dynamically loaded extension for python that provides access to the graph facilities of graphviz. COMMANDS
New graphs New empty graph graph_handle gv.graph (name); graph_handle gv.digraph (name); graph_handle gv.strictgraph (name); graph_handle gv.strictdigraph (name); New graph from a dot-syntax string or file graph_handle gv.readstring (string); graph_handle gv.read (string filename); graph_handle gv.read (channel); Add new subgraph to existing graph graph_handle gv.graph (graph_handle, name); New nodes Add new node to existing graph node_handle gv.node (graph_handle, name); New edges Add new edge between existing nodes edge_handle gv.edge (tail_node_handle, head_node_handle); Add a new edge between an existing tail node, and a named head node which will be induced in the graph if it doesn't already exist edge_handle gv.edge (tail_node_handle, head_name); Add a new edge between an existing head node, and a named tail node which will be induced in the graph if it doesn't already exist edge_handle gv.edge (tail_name, head_node_handle); Add a new edge between named tail and head nodes which will be induced in the graph if they don't already exist edge_handle gv.edge (graph_handle, tail_name, head_name); Setting attribute values Set value of named attribute of graph/node/edge - creating attribute if necessary string gv.setv (graph_handle, attr_name, attr_value); string gv.setv (node_handle, attr_name, attr_value); string gv.setv (edge_handle, attr_name, attr_value); Set value of existing attribute of graph/node/edge (using attribute handle) string gv.setv (graph_handle, attr_handle, attr_value); string gv.setv (node_handle, attr_handle, attr_value); string gv.setv (edge_handle, attr_handle, attr_value); Getting attribute values Get value of named attribute of graph/node/edge string gv.getv (graph_handle, attr_name); string gv.getv (node_handle, attr_name); string gv.getv (edge_handle, attr_name); Get value of attribute of graph/node/edge (using attribute handle) string gv.getv (graph_handle, attr_handle); string gv.getv (node_handle, attr_handle); string gv.getv (edge_handle, attr_handle); Obtain names from handles string gv.nameof (graph_handle); string gv.nameof (node_handle); string gv.nameof (attr_handle); Find handles from names graph_handle gv.findsubg (graph_handle, name); node_handle gv.findnode (graph_handle, name); edge_handle gv.findedge (tail_node_handle, head_node_handle); attribute_handle gv.findattr (graph_handle, name); attribute_handle gv.findattr (node_handle, name); attribute_handle gv.findattr (edge_handle, name); Misc graph navigators returning handles node_handle gv.headof (edge_handle); node_handle gv.tailof (edge_handle); graph_handle gv.graphof (graph_handle); graph_handle gv.graphof (edge_handle); graph_handle gv.graphof (node_handle); graph_handle gv.rootof (graph_handle); Obtain handles of proto node/edge for setting default attribute values node_handle gv.protonode (graph_handle); edge_handle gv.protoedge (graph_handle); Iterators Iteration termination tests bool gv.ok (graph_handle); bool gv.ok (node_handle); bool gv.ok (edge_handle); bool gv.ok (attr_handle); Iterate over subgraphs of a graph graph_handle gv.firstsubg (graph_handle); graph_handle gv.nextsubg (graph_handle, subgraph_handle); Iterate over supergraphs of a graph (obscure and rarely useful) graph_handle gv.firstsupg (graph_handle); graph_handle gv.nextsupg (graph_handle, subgraph_handle); Iterate over edges of a graph edge_handle gv.firstedge (graph_handle); edge_handle gv.nextedge (graph_handle, edge_handle); Iterate over outedges of a graph edge_handle gv.firstout (graph_handle); edge_handle gv.nextout (graph_handle, edge_handle); Iterate over edges of a node edge_handle gv.firstedge (node_handle); edge_handle gv.nextedge (node_handle, edge_handle); Iterate over out-edges of a node edge_handle gv.firstout (node_handle); edge_handle gv.nextout (node_handle, edge_handle); Iterate over head nodes reachable from out-edges of a node node_handle gv.firsthead (node_handle); node_handle gv.nexthead (node_handle, head_node_handle); Iterate over in-edges of a graph edge_handle gv.firstin (graph_handle); edge_handle gv.nextin (node_handle, edge_handle); Iterate over in-edges of a node edge_handle gv.firstin (node_handle); edge_handle gv.nextin (graph_handle, edge_handle); Iterate over tail nodes reachable from in-edges of a node node_handle gv.firsttail (node_handle); node_handle gv.nexttail (node_handle, tail_node_handle); Iterate over nodes of a graph node_handle gv.firstnode (graph_handle); node_handle gv.nextnode (graph_handle, node_handle); Iterate over nodes of an edge node_handle gv.firstnode (edge_handle); node_handle gv.nextnode (edge_handle, node_handle); Iterate over attributes of a graph attribute_handle gv.firstattr (graph_handle); attribute_handle gv.nextattr (graph_handle, attr_handle); Iterate over attributes of an edge attribute_handle gv.firstattr (edge_handle); attribute_handle gv.nextattr (edge_handle, attr_handle); Iterate over attributes of a node attribute_handle gv.firstattr (node_handle); attribute_handle gv.nextattr (node_handle, attr_handle); Remove graph objects bool gv.rm (graph_handle); bool gv.rm (node_handle); bool gv.rm (edge_handle); Layout Annotate a graph with layout attributes and values using a specific layout engine bool gv.layout (graph_handle, string engine); Render Render a layout into attributes of the graph bool gv.render (graph_handle); Render a layout to stdout bool gv.render (graph_handle, string format); Render to an open file bool gv.render (graph_handle, string format, channel fout); Render a layout to an unopened file by name bool gv.render (graph_handle, string format, string filename); Render to an open channel bool gv.renderchannel (graph_handle, string format, string channelname); Render to a string result gv.renderresult (graph_handle, string format, string outdata); Render a layout to a malloc'ed string, to be free'd by the caller (deprecated - too easy to leak memory) (still needed for "eval [gv::renderdata $G tk]" ) string gv.renderdata (graph_handle, string format); Writing graph back to file bool gv.write (graph_handle, string filename); bool gv.write (graph_handle, channel); KEYWORDS
graph, dot, neato, fdp, circo, twopi, python. 11 January 2014 gv(3python)
All times are GMT -4. The time now is 07:37 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy