Sponsored Content
Top Forums Shell Programming and Scripting Shell script to populate an array from a csv file Post 302597246 by Corona688 on Thursday 9th of February 2012 05:45:47 PM
Old 02-09-2012
You need the {} brackets.

Code:
echo ${ARR[2]}

---------- Post updated at 04:45 PM ---------- Previous update was at 04:42 PM ----------

I think I made an error in my original code.

Code:
set -- $STR

not
Code:
set -- "$STR"

The quotes will prevent it from splitting.
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

using the getline to populate an array from a file

Hello, I am trying to use the awk getline command to populate an array from a flat file. Has anyone done this before? So we have file1: a b c d I want to create an array like index that contains these four elements (8 Replies)
Discussion started by: penfold
8 Replies

2. Shell Programming and Scripting

Modifying a csv file from Shell Script

Hi all, I have some script that creates a temp csv file. What I need to do is do some search and replace and modify the file from my shell script. I know the commands to open the file and then apply the reg ex but wasnt sure how I could do this from a script and modify the file? Any help... (2 Replies)
Discussion started by: not4google
2 Replies

3. UNIX for Advanced & Expert Users

format csv file using shell script

i have a report.csv file from oracle datavase In that file data is like this with report heading and date SALES DAILY REPORT DATE: 06-26-2007 REPORT NAME: SALES DATA AA.BB.CCCC.DDDD,BBBBB,06-26-2007,0,BEGIN,END ZZ.VV.DDDD.XXXXXXX,MMMMMM,06-25-2007,18,BEGIN,END... (3 Replies)
Discussion started by: raosurya
3 Replies

4. Shell Programming and Scripting

how to create csv file using shell script

I have a file in multiple directory which has some records in the following format File: a/latest.txt , b/latest.txt, c/latest.txt -> Name=Jhon Age=27 Gender=M Street=LA Road Occupation=Service I want to generate a csv file from the above file as follows File: output.csv -> ... (9 Replies)
Discussion started by: rjk2504
9 Replies

5. Shell Programming and Scripting

populate specified value in csv

Hi, I've requirement of populating two blank column ( 4rth and 6th ) in a csv file with specified value for all the rows having value within the first colmn. I know it can be done with sed, as given in the below command, but i am not sure how pull blank value or specify target column etc or... (11 Replies)
Discussion started by: john_prince
11 Replies

6. Shell Programming and Scripting

Using eval to populate an array in the background

Hi. I am trying to populate an array using eval in the background within a function. So this function will create a list of 3 character directories from SVN and store in an array. I want to call this function when the script starts in the background unknown to the user. The problem is that... (2 Replies)
Discussion started by: jmiaebrown
2 Replies

7. UNIX for Dummies Questions & Answers

Help to parse csv file with shell script

Hello ! I am very aware that this is not the first time this question is asked here, because I have already read a lot of previous answers, but none of them worked, so... As said in the title, I want to read a csv file with a bash script. Here is a sample of the file: ... (4 Replies)
Discussion started by: Grhyll
4 Replies

8. Shell Programming and Scripting

Reading a csv file using shell script

Hello All, I have a csv file that looks like below ProdId_A,3.3.3,some text,some/text,sometext_1.2.3 ProdId_B,3.3.3,some text,some/text,sometext_1.2.3 ProdId_C,3.3.3,some text,some/text,sometext_1.2.3 ProdId_A,6.6.6,some text,some/text,sometext_9.9.9 I will get ProdId from... (5 Replies)
Discussion started by: anand.shah
5 Replies

9. Shell Programming and Scripting

CSV File Creation Within Shell Script

Hi All, I am trying to create a CSV file within a shell script test.ksh and the code snippet is something like below: #!/usr/bin/ksh # Set required variables. . $HOME/.prof # Output file path Group1=/tmp/G1.csv Group2=/tmp/G2.csv Group3=/tmp/G3.csv $ORACLE_HOME/bin/sqlplus -s... (2 Replies)
Discussion started by: swasid
2 Replies

10. Shell Programming and Scripting

Help with Shell Scrip in Masking particular columns in .csv file or .txt file using shell script

Hello Unix Shell Script Experts, I have a script that would mask the columns in .csv file or .txt file. First the script will untar the .zip files from Archive folder and processes into work folder and finally pushes the masked .csv files into Feed folder. Two parameters are passed ... (5 Replies)
Discussion started by: Mahesh G
5 Replies
CSS::DOM::Interface(3pm)				User Contributed Perl Documentation				  CSS::DOM::Interface(3pm)

NAME
CSS::DOM::Interface - A list of CSS::DOM's interface members in machine-readable format VERSION
Version 0.14 SYNOPSIS
use CSS::DOM::Interface ':all'; # name of DOM interface (CSSStyleRule): $CSS::DOM::Interface{"CSS::DOM::Rule::Style"}; # interface it inherits from (CSSRule): $CSS::DOM::Interface{CSSStyleRule}{_isa}; # whether this can be used as an array $CSS::DOM::Interface{MediaList}{_array}; # true # or hash $CSS::DOM::Interface{MediaList}{_hash}; # false # Properties and Methods # list them all grep !/^_/, keys %{ $CSS::DOM::Interface{CSSStyleSheet} }; # see whether a given property is supported exists $CSS::DOM::Interface{CSSStyleSheet}{foo}; # false # Is it a method? $CSS::DOM::Interface{CSSStyleSheet}{cssRules} & METHOD; # false $CSS::DOM::Interface{CSSStyleSheet}{insertRule} & METHOD; # true # Does the method return nothing? $CSS::DOM::Interface{MediaList}{deleteMedium} & VOID; # true # Is a property read-only? $CSS::DOM::Interface{StyleSheetList}{length} & READONLY; # true # Data types of properties ($CSS::DOM::Interface{CSSStyleSheet}{type} & TYPE) == STR; # true ($CSS::DOM::Interface{CSSStyleSheet}{disabled} & TYPE) == BOOL; # true ($CSS::DOM::Interface{CSSStyleSheet}{ownerNode} & TYPE) == NUM; # false ($CSS::DOM::Interface{CSSStyleSheet}{href} & TYPE) == OBJ; # false # and return types of methods: ($CSS::DOM::Interface{MediaList}{item} & TYPE) == STR; # true ($CSS::DOM::Interface{CSSMediaRule} ->{insertRule} & TYPE) == BOOL; # false ($CSS::DOM::Interface{CSSStyleDeclaration} ->{getPropertyVaue} & TYPE) == NUM; # false ($CSS::DOM::Interface{CSSStyleDeclaration} ->{removeProperty} & TYPE) == OBJ; # false # Constants # list of constant names in the form "CSS::DOM::Node::STYLE_RULE"; @{ $CSS::DOM::Interface{CSSRule}{_constants} }; DESCRIPTION
The synopsis should tell you almost everything you need to know. But be warned that "$foo & TYPE" is meaningless when "$foo & METHOD" and "$foo & VOID" are both true. For more gory details, look at the source code. In fact, here it is: our @EXPORT_OK = qw/METHOD VOID READONLY BOOL STR NUM OBJ TYPE/; our %EXPORT_TAGS = (all => @EXPORT_OK); sub METHOD () { 1 } sub VOID () { 0b10 } # for methods sub READONLY () { 0b10 } # for properties sub BOOL () { 0b0000 } sub STR () { 0b0100 } sub NUM () { 0b1000 } sub OBJ () { 0b1100 } sub TYPE () { 0b1100 } # only for use as a mask %CSS::DOM::Interface = ( 'CSS::DOM' => 'CSSStyleSheet', 'CSS::DOM::StyleSheetList' => 'StyleSheetList', 'CSS::DOM::MediaList' => 'MediaList', 'CSS::DOM::RuleList' => 'CSSRuleList', 'CSS::DOM::Rule' => 'CSSRule', 'CSS::DOM::Rule::Style' => 'CSSStyleRule', 'CSS::DOM::Rule::Media' => 'CSSMediaRule', 'CSS::DOM::Rule::FontFace' => 'CSSFontFaceRule', 'CSS::DOM::Rule::Page' => 'CSSPageRule', 'CSS::DOM::Rule::Import' => 'CSSImportRule', 'CSS::DOM::Rule::Charset' => 'CSSCharsetRule', 'CSS::DOM::Style' => 'CSSStyleDeclaration', 'CSS::DOM::Value' => 'CSSValue', 'CSS::DOM::Value::Primitive' => 'CSSPrimitiveValue', 'CSS::DOM::Value::List' => 'CSSValueList', 'CSS::DOM::Counter' => 'Counter', StyleSheetList => { _hash => 0, _array => 1, length => NUM | READONLY, item => METHOD | OBJ, }, MediaList => { _hash => 0, _array => 1, mediaText => STR, length => NUM | READONLY, item => METHOD | STR, deleteMedium => METHOD | VOID, appendMedium => METHOD | VOID, }, CSSRuleList => { _hash => 0, _array => 1, length => NUM | READONLY, item => METHOD | OBJ, }, CSSRule => { _hash => 0, _array => 0, _constants => [qw[ CSS::DOM::Rule::UNKNOWN_RULE CSS::DOM::Rule::STYLE_RULE CSS::DOM::Rule::CHARSET_RULE CSS::DOM::Rule::IMPORT_RULE CSS::DOM::Rule::MEDIA_RULE CSS::DOM::Rule::FONT_FACE_RULE CSS::DOM::Rule::PAGE_RULE ]], type => NUM | READONLY, cssText => STR, parentStyleSheet => OBJ | READONLY, parentRule => OBJ | READONLY, }, CSSStyleRule => { _isa => 'CSSRule', _hash => 0, _array => 0, selectorText => STR, style => OBJ | READONLY, }, CSSMediaRule => { _isa => 'CSSRule', _hash => 0, _array => 0, media => OBJ | READONLY, cssRules => OBJ | READONLY, insertRule => METHOD | NUM, deleteRule => METHOD | VOID, }, CSSFontFaceRule => { _isa => 'CSSRule', _hash => 0, _array => 0, style => OBJ | READONLY, }, CSSPageRule => { _isa => 'CSSRule', _hash => 0, _array => 0, selectorText => STR, style => OBJ | READONLY, }, CSSImportRule => { _isa => 'CSSRule', _hash => 0, _array => 0, href => STR | READONLY, media => OBJ | READONLY, styleSheet => OBJ | READONLY, }, CSSCharsetRule => { _isa => 'CSSRule', _hash => 0, _array => 0, encoding => STR, }, CSSStyleDeclaration => { _hash => 0, _array => 1, cssText => STR, getPropertyValue => METHOD | STR, getPropertyCSSValue => METHOD | OBJ, removeProperty => METHOD | STR, getPropertyPriority => METHOD | STR, setProperty => METHOD | VOID, length => NUM | READONLY, item => METHOD | STR, parentRule => OBJ | READONLY, azimuth => STR, background => STR, backgroundAttachment => STR, backgroundColor => STR, backgroundImage => STR, backgroundPosition => STR, backgroundRepeat => STR, border => STR, borderCollapse => STR, borderColor => STR, borderSpacing => STR, borderStyle => STR, borderTop => STR, borderRight => STR, borderBottom => STR, borderLeft => STR, borderTopColor => STR, borderRightColor => STR, borderBottomColor => STR, borderLeftColor => STR, borderTopStyle => STR, borderRightStyle => STR, borderBottomStyle => STR, borderLeftStyle => STR, borderTopWidth => STR, borderRightWidth => STR, borderBottomWidth => STR, borderLeftWidth => STR, borderWidth => STR, bottom => STR, captionSide => STR, clear => STR, clip => STR, color => STR, content => STR, counterIncrement => STR, counterReset => STR, cue => STR, cueAfter => STR, cueBefore => STR, cursor => STR, direction => STR, display => STR, elevation => STR, emptyCells => STR, cssFloat => STR, font => STR, fontFamily => STR, fontSize => STR, fontSizeAdjust => STR, fontStretch => STR, fontStyle => STR, fontVariant => STR, fontWeight => STR, height => STR, left => STR, letterSpacing => STR, lineHeight => STR, listStyle => STR, listStyleImage => STR, listStylePosition => STR, listStyleType => STR, margin => STR, marginTop => STR, marginRight => STR, marginBottom => STR, marginLeft => STR, markerOffset => STR, marks => STR, maxHeight => STR, maxWidth => STR, minHeight => STR, minWidth => STR, opacity => STR, orphans => STR, outline => STR, outlineColor => STR, outlineStyle => STR, outlineWidth => STR, overflow => STR, padding => STR, paddingTop => STR, paddingRight => STR, paddingBottom => STR, paddingLeft => STR, page => STR, pageBreakAfter => STR, pageBreakBefore => STR, pageBreakInside => STR, pause => STR, pauseAfter => STR, pauseBefore => STR, pitch => STR, pitchRange => STR, playDuring => STR, position => STR, quotes => STR, richness => STR, right => STR, size => STR, speak => STR, speakHeader => STR, speakNumeral => STR, speakPunctuation => STR, speechRate => STR, stress => STR, tableLayout => STR, textAlign => STR, textDecoration => STR, textIndent => STR, textShadow => STR, textTransform => STR, top => STR, unicodeBidi => STR, verticalAlign => STR, visibility => STR, voiceFamily => STR, volume => STR, whiteSpace => STR, widows => STR, width => STR, wordSpacing => STR, zIndex => STR, }, CSSValue => { _hash => 0, _array => 0, _constants => [qw[ CSS::DOM::Value::CSS_INHERIT CSS::DOM::Value::CSS_PRIMITIVE_VALUE CSS::DOM::Value::CSS_VALUE_LIST CSS::DOM::Value::CSS_CUSTOM ]], cssText => STR, cssValueType => NUM | READONLY, }, CSSPrimitiveValue => { _isa => 'CSSValue', _hash => 0, _array => 0, _constants => [qw[ CSS::DOM::Value::Primitive::CSS_UNKNOWN CSS::DOM::Value::Primitive::CSS_NUMBER CSS::DOM::Value::Primitive::CSS_PERCENTAGE CSS::DOM::Value::Primitive::CSS_EMS CSS::DOM::Value::Primitive::CSS_EXS CSS::DOM::Value::Primitive::CSS_PX CSS::DOM::Value::Primitive::CSS_CM CSS::DOM::Value::Primitive::CSS_MM CSS::DOM::Value::Primitive::CSS_IN CSS::DOM::Value::Primitive::CSS_PT CSS::DOM::Value::Primitive::CSS_PC CSS::DOM::Value::Primitive::CSS_DEG CSS::DOM::Value::Primitive::CSS_RAD CSS::DOM::Value::Primitive::CSS_GRAD CSS::DOM::Value::Primitive::CSS_MS CSS::DOM::Value::Primitive::CSS_S CSS::DOM::Value::Primitive::CSS_HZ CSS::DOM::Value::Primitive::CSS_KHZ CSS::DOM::Value::Primitive::CSS_DIMENSION CSS::DOM::Value::Primitive::CSS_STRING CSS::DOM::Value::Primitive::CSS_URI CSS::DOM::Value::Primitive::CSS_IDENT CSS::DOM::Value::Primitive::CSS_ATTR CSS::DOM::Value::Primitive::CSS_COUNTER CSS::DOM::Value::Primitive::CSS_RECT CSS::DOM::Value::Primitive::CSS_RGBCOLOR ]], primitiveType => NUM | READONLY, setFloatValue => METHOD | VOID, getFloatValue => METHOD | NUM, setStringValue => METHOD | VOID, getStringValue => METHOD | STR, # getCounterValue => METHOD | OBJ, # getRectValue => METHOD | OBJ, # getRGBColorValue => METHOD | OBJ, red => OBJ | READONLY, green => OBJ | READONLY, blue => OBJ | READONLY, alpha => OBJ | READONLY, top => OBJ | READONLY, right => OBJ | READONLY, bottom => OBJ | READONLY, left => OBJ | READONLY, }, CSSValueList => { _isa => 'CSSValue', _hash => 0, _array => 1, length => NUM | READONLY, item => METHOD | OBJ, }, # Counter => { # _hash => 0, # _array => 0, # identifier => STR | READONLY, # listStyle => STR | READONLY, # separator => STR | READONLY, # }, CSSStyleSheet => { type => STR | READONLY, _hash => 0, _array => 0, disabled => BOOL, ownerNode => OBJ | READONLY, parentStyleSheet => OBJ | READONLY, href => STR | READONLY, title => STR | READONLY, media => OBJ | READONLY, ownerRule => OBJ | READONLY, cssRules => OBJ | READONLY, insertRule => METHOD | NUM, deleteRule => METHOD | VOID, }, ); __END__ SEE ALSO
CSS::DOM perl v5.10.1 2010-12-10 CSS::DOM::Interface(3pm)
All times are GMT -4. The time now is 04:50 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy