Sponsored Content
Top Forums UNIX for Dummies Questions & Answers to assign cut values to an array Post 302142655 by Syms on Monday 29th of October 2007 04:07:28 AM
Old 10-29-2007
to assign cut values to an array

i need to seperate values seperated by delimiters and assign it to an array.. can u plz help me on that.

Variables = "asd,rgbh,(,rty,got,),sroe,9034,"
i need to assign the variables into arrays..
like..

var[0]=asd
var[1]=rgbh.. and so on
how do i do this. i need to reuse the values stored in the arrays.Is it possible.. ?
how do i do it using awk command?

Last edited by Syms; 10-29-2007 at 07:36 AM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Assign variables with cut

I need to read a file (a list) and assign the value to a variable (for each line), I'm looping until the end of the file. My problem is, I want to assign 2 separate variables from the list. The process I'm using is: awk '{print $3}' file1 > file2 awk '{print $4}' file1 > file3 cat file2... (2 Replies)
Discussion started by: douknownam
2 Replies

2. UNIX for Dummies Questions & Answers

Cut Command value assign to variable

Hi, I am new to UNIX Scripting. I have been trying to use the CUT command to retrieve part of the header from a file and assign it to a variable. I have tried searching a lot, but I am still unsuccessful. Sample Header: HJAN BALANCE 20090616 I need to retrieve the date here, which always... (10 Replies)
Discussion started by: ragz_82
10 Replies

3. Shell Programming and Scripting

PHP: Search Multi-Dimensional(nested) array and export values of currenly worked on array.

Hi All, I'm writing a nagios check that will see if our ldap servers are in sync... I got the status data into a nested array, I would like to search key of each array and if "OK" is NOT present, echo other key=>values in the current array to a variable so...eg...let take the single array... (1 Reply)
Discussion started by: zeekblack
1 Replies

4. Shell Programming and Scripting

Select multiple values from an Oracle database and assign it to two dimensional array

hi I have two tables in oracle DB and am using a joining query which will result in the output as follows. i need to assign it to a two dimensional array and use it for my further calculations. the way i tried is as follows. #!/bin/ksh export... (1 Reply)
Discussion started by: aemunathan
1 Replies

5. Shell Programming and Scripting

Cut text and assign them into array

file.txt : is delimiter: abc:def:ghi jkl:mno: pqr 123:456:789 if I do the cut command, and cut the first column, and echo it out I will get the output: abc jkl 123 How can I assign the column of text that I've cut into Array? e.g If I were to echo array array it will output as:... (9 Replies)
Discussion started by: andylbh
9 Replies

6. Shell Programming and Scripting

Read variables names from array and assign the values

Hi, I have requirement to assign values to variables which are created dynamically. Below is the code which i am using to achieve above requirement. #!/bin/ksh oIFS="$IFS"; IFS=',' STR_FAIL_PARENT_IF_FAILS="WF_F_P_IF_FAILS1,WF_F_P_IF_FAILS2,WF_F_P_IF_FAILS3" set -A... (1 Reply)
Discussion started by: tmalik79
1 Replies

7. Shell Programming and Scripting

How to Assign an shell array to awk array?

Hello All, Can you please help me with the below. #!/bin/bash ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5 EXTRACT_DT:30-SEP-12 VER_NUM:1" ARR="No Differences In Stage Between HASH_TOTALS & HASH_TOTALS_COMP For UNINUM:0722075 PROVIDER:5... (14 Replies)
Discussion started by: Ariean
14 Replies

8. Shell Programming and Scripting

Read record from the text file contain multiple separated values & assign those values to variables

I have a file containing multiple values, some of them are pipe separated which are to be read as separate values and some of them are single value all are these need to store in variables. I need to read this file which is an input to my script Config.txt file name, first path, second... (7 Replies)
Discussion started by: ketanraut
7 Replies

9. Shell Programming and Scripting

How to assign value to variable using cut?

Hey guys. Below is the command I am using to assign "yellow" to the variable yellow. I can seem to echo it out using xargs but when I assign it to yellow and then try to echo it out it prints a blank line. Below is the command. Your help is highly appreciated! cut -c 2- color.txt |... (11 Replies)
Discussion started by: eldan88
11 Replies

10. UNIX for Beginners Questions & Answers

How To Read a File and Assign the line values to an Array?

i have this basic code that i wrote to read a file and place it's values to an array. the source/input file will have multiple strings on it that is separated by a whitespace. sample_list.txt file contents: ACCT1 TABLE1 ACCT2 TABLE2 ACCT3 TABLE3 script file: sample_list.sh ... (3 Replies)
Discussion started by: wtolentino
3 Replies
MPSVectorDescriptor(3)					 MetalPerformanceShaders.framework				    MPSVectorDescriptor(3)

NAME
MPSVectorDescriptor SYNOPSIS
#import <MPSMatrixTypes.h> Inherits NSObject. Class Methods (__nonnull instancetype) + vectorDescriptorWithLength:dataType: (__nonnull instancetype) + vectorDescriptorWithLength:vectors:vectorBytes:dataType: (size_t) + vectorBytesForLength:dataType: Properties NSUInteger length NSUInteger vectors MPSDataType dataType NSUInteger vectorBytes Detailed Description This depends on Metal.framework A MPSVectorDescriptor describes the length and data type of a an array of 1-dimensional vectors. All vectors are stored as contiguous arrays of data. Method Documentation + (size_t) vectorBytesForLength: (NSUInteger) length(MPSDataType) dataType Return the recommended stride, in bytes, to be used for an array of vectors of a given length. Parameters: length The number of elements in a single vector. dataType The type of vector data values. To achieve best performance the optimal stride between vectors within an array of vectors is not necessarily equivalent to the number of elements per vector. This method returns the stride, in bytes, which gives best performance for a given vector length. Using this stride to construct your array is recommended, but not required (provided that the stride used is still large enough to allocate a full vector of data). + (__nonnull instancetype) vectorDescriptorWithLength: (NSUInteger) length(MPSDataType) dataType Create a MPSVectorDescriptor with the specified length and data type. Parameters: length The number of elements in a single vector. dataType The type of the data to be stored in the vector. Use this function for creating a descriptor of a MPSVector object containing a single vector. + (__nonnull instancetype) vectorDescriptorWithLength: (NSUInteger) length(NSUInteger) vectors(NSUInteger) vectorBytes(MPSDataType) dataType Create a MPSVectorDescriptor with the specified length and data type. Parameters: length The number of elements in a single vector. vectors The number of vectors in the MPSVector object. vectorBytes The number of bytes between starting elements of consecutive vectors. dataType The type of the data to be stored in the vector. For performance considerations the optimal stride between vectors may not necessarily be equal to the vector length. The MPSVectorDescriptor class provides a method which may be used to determine this value, see the vectorBytesForLength API. Property Documentation - dataType [read], [write], [nonatomic], [assign] The type of the data which makes up the values of the vector. - length [read], [write], [nonatomic], [assign] The number of elements in the vector. - vectorBytes [read], [nonatomic], [assign] The stride, in bytes, between corresponding elements of consecutive vectors. Must be a multiple of the element size - vectors [read], [nonatomic], [assign] The number of vectors. Author Generated automatically by Doxygen for MetalPerformanceShaders.framework from the source code. Version MetalPerformanceShaders-100 Thu Feb 8 2018 MPSVectorDescriptor(3)
All times are GMT -4. The time now is 07:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy