Sponsored Content
Top Forums Shell Programming and Scripting Manipulating Pick multi dimensional data with awk. Post 302332306 by mike.strategis on Wednesday 8th of July 2009 04:41:20 PM
Old 07-08-2009
Hi Franklin. I guess that would have been helpful!

I am looking for the following;

DEVICES,DESCRIPTION OF DEVICES,24,99,499,999,2999,99999,22.35,21.60,19.85,18.35,17.62,16.00,
BAGS,DESCRIPTION OF BAGS,24,99,499,999,4999,99999,0,0,0,0,0,0,
ITEMS,DESCRIPTION OF CARS,24,99,499,999,2999,99999,0,0,0,0,17.62,0.00,
BAGS,DESCRIPTION OF BAGS,24,99,499,999,4999,99999,12.30,0,0,0,0,0,

My script delivers this when there are full lines, but not when there are not.

Hope you can help.
 

9 More Discussions You Might Find Interesting

1. Programming

Multi-Dimensional Arrays

So, I'm fooling around with multi demtional arrays, and I made this in a short amount of time: #include <stdio.h> main(int argc, char *argv) { char blah = { {'a', 'b'}, {'b', 'a'} }; int i = 0; while (i < 2) { if (argv == blah) printf("%c\n", blah); i++; } } The goal... (3 Replies)
Discussion started by: Octal
3 Replies

2. Shell Programming and Scripting

Multi Dimensional array in KSH

Is there any way to use multi dim. array in KSH ? (1 Reply)
Discussion started by: sinpeak
1 Replies

3. Shell Programming and Scripting

Match elements in an AWK multi-dimensional array

Hello, I have two files in the following format; file1: A B C D E F G H I J K L file2: 1 2 3 4 5 6 7 8 9 10 11 12 I have read them both in to multi-dimensional arrays. I need a file that has column 2 of the first file printed out for each column 3 of the second file ie... ... (3 Replies)
Discussion started by: cold_Que
3 Replies

4. Shell Programming and Scripting

sorting multi dimensional array

Hi there, Can someone let me know how to sort the 2 dimensional array below by column 1 then by column 2? 22 55 2222 2230 33 66 44 58 222 240 11 25 22 60 33 45 output: 11 25 22 55 22 60 33 45 33 66 44 58 (6 Replies)
Discussion started by: phoeberunner
6 Replies

5. Shell Programming and Scripting

How to pick a group of data using awk/ksh

Hi gurus, I have data coming in as shown below. And in each case, I need to pick the data in the last group as shown below. Data Set 1: DC | 18161621 LA | 15730880 NY | 16143237 DC | 18161621 LA | 17316397 NY | 17915905 DC | 18161621 LA | 17993534 NY | 18161621 DC | 18161621... (11 Replies)
Discussion started by: calredd
11 Replies

6. Shell Programming and Scripting

Manipulating a list into a two-dimensional array

hi, total newbie to shell scripting and wondering if some of you guru's can give me a hand on a problem I'm trying to solve. The tmplsnr.a file contains LSNR_51526 db1 db2 LSNR_51527 db3 db4 db5 Summary - depending on which db is set, the script will start the relevant listener... (5 Replies)
Discussion started by: mingy10
5 Replies

7. Shell Programming and Scripting

Manipulating xml data with awk

Hi everyone, I have a little bit of complicated task to finish with AWK. Here it is; I have a data file in xml format which looks like this <data> a1 a2 a3 a4 a5 b1 b2 b3 b4 b5 c1 c2 c3 c4 c5 d1 d2 d3 d4 d5 e1 e2 e3 e4 e5 </data> lets say each data block contains 5 rows and 5 columns,... (13 Replies)
Discussion started by: hayreter
13 Replies

8. Shell Programming and Scripting

Multi Dimensional array

I have an array of names. Each one of the name, has a number represented to it. For example A has an ID 8, B has an ID 2. What I am after is a for loop that when the array is in position 1, a particular variable is set to the value of position 1 in array 2 declare -a arr=("A" "B" "C"... (6 Replies)
Discussion started by: nms
6 Replies

9. Shell Programming and Scripting

Multi Dimensional array in bash

Hi, I'm developing a script which contains a multi dimensional array, however for some reason the array is not iterating. When executing the script, services are listed as arguments from argument 2. Ex voice data sms. service=${@:2}; for services in $service do ... (2 Replies)
Discussion started by: nms
2 Replies
Version::Next(3pm)					User Contributed Perl Documentation					Version::Next(3pm)

NAME
Version::Next - increment module version numbers simply and correctly VERSION
version 0.002 SYNOPSIS
use Version::Next; my $new_version = next_version( $old_version ); DESCRIPTION
This module provides a simple, correct way to increment a Perl module version number. It does not attempt to guess what the original version number author intended, it simply increments in the smallest possible fashion. Decimals are incremented like an odometer. Dotted decimals are incremented piecewise and presented in a standardized way. If more complex version manipulation is necessary, you may wish to consider Perl::Version. USAGE
This module uses Sub::Exporter for optional exporting. Nothing is exported by default. "next_version" my $new_version = next_version( $old_version ); Given a string, this function make the smallest logical increment and returns it. The input string is very minimally checked that it resembles a version number. Given "undef", the function returns 0. Decimal versions are incremented like an odometer, preserving the original number of decimal places. If an underscore is present (indicating an "alpha" version), its relative position is preserved. Examples: 0.001 -> 0.002 0.999 -> 1.000 0.1229 -> 0.1230 0.12_34 -> 0.12_35 0.12_99 -> 0.13_00 Dotted-decimal versions have the least significant element incremented by one. If the result exceeds 999, the element resets to 0 and the next most significant element is incremented, and so on. Any leading zero padding is removed. Examples: v1.2.3 -> v1.2.4 v1.2.999 -> v1.3.0 v1.999.999 -> v2.0.0 v1.2.3_4 -> v1.2.3_5 v1.2.3_999 -> v1.2.4_0 SEE ALSO
o Perl::Version AUTHOR
David Golden <dagolden@cpan.org> COPYRIGHT AND LICENSE
This software is Copyright (c) 2010 by David Golden. This is free software, licensed under: The Apache License, Version 2.0, January 2004 perl v5.10.1 2010-10-01 Version::Next(3pm)
All times are GMT -4. The time now is 06:50 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy