10-31-2008
Concatenating arrays cell values in shell scripting
Hi All,
I want to concatenate the array cell values and form a string.. Is it possible?
for ex.
I have an array
word_array contains d u m b and after concatenating the string shld be 'dumb'
thanks
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I have a ',' delimited file and i would like concatenate a new value at a specific column.
Example :-
xXXX,XYZ,20071005,ABC,DEF,123
xXXX,XYZ,20071005,ABC,DEF,123
xXXX,XYZ,20071005,ABC,DEF,123
The output that i want is
xXXX,XYZ,20071005001,ABC,DEF,123... (7 Replies)
Discussion started by: amitkhiare
7 Replies
2. Shell Programming and Scripting
Friends,
I have to execute a command and store its contents into an array using shell. this is what i have tried
#!/bin/bash
disk_names = ($(`iostat -xtc | egrep -v "device|nfs" | awk '{print $1}'| tr '\n' ' ' `))
But its throwing an error message as
./test-script
./test-script:... (6 Replies)
Discussion started by: achak01
6 Replies
3. UNIX for Advanced & Expert Users
I need help to create a csv file with Unix command.
In csv file, i need to put two values in the same cell.
Rite now, whts happening is, if i put 2 values in the same cell, its comming as " asd, zxc" but i want it in different line but in same cell.
asd
zxc
Please reply me ASAP. (1 Reply)
Discussion started by: Prashant Jain
1 Replies
4. Shell Programming and Scripting
I have the following script in a shell
# The start of a filename
file=$(ls -tr $EMT*.dat | tail -1) # Select the latest file echo $file
file_seq=$( < /u02/sct/banner/bandev2/xxxxxx/misc/EFTSQL.dat)
echo $file_seq
file2 = '$file_seq + 1'
echo $file2
It is reading a file EFTSQL.dat... (3 Replies)
Discussion started by: rechever
3 Replies
5. Shell Programming and Scripting
sample content of file1:
SSTY1 2145228348 652011011715140100000002419005432092074 008801726143662 VDZX01 MIO2 008801726143662
SSRTY 2145228349 ... (3 Replies)
Discussion started by: vsachan
3 Replies
6. Shell Programming and Scripting
hi
My script as below
#!/bin/ksh
for i in `seq 1 7`
do
a=$(awk '{print $i}' /home/rama/expenese.txt)
done
for i in `seq 1 7`
do
echo "${a}"
done
content of expense.txt is as below
5032 210179 3110 132813874 53488966 11459221 5300794
I want output as... (6 Replies)
Discussion started by: Ramakrishna V
6 Replies
7. UNIX for Dummies Questions & Answers
:wall:
Hi
I am a newbie with Shell Scripting who stuck while creating a shell script for Pythagoras theorem.I need to know how to add the squares for the value in shell scripting(for eg: b2 =a2 +c2).
Thanks
VR (4 Replies)
Discussion started by: VoraciousReader
4 Replies
8. Shell Programming and Scripting
Hi
After lot of trial and error I am really bowled out with the requirement in hand and honestly you are my last hope
Here is what I want to achieve
Values
*IF *VALUE MS_SQL_Statistics_Summary.Client_Count_Percent_Used *GT 70.00 *AND *VALUE... (20 Replies)
Discussion started by: radioactive9
20 Replies
9. Shell Programming and Scripting
I have two files:
file-1 is a list of number of interfaces in the switch and file-2 have VLAN-ID , VLAN-NAME , Interface belong to that VLAN like this:
file-1:
1/1
1/2
1/3
1/4
1/5
.
.
file-2:
1,"vlan-wifi",1/1,1/7,1/8 (9 Replies)
Discussion started by: SULTAN01
9 Replies
LEARN ABOUT CENTOS
th_make_cells
thai/thcell.h(3) libthai thai/thcell.h(3)
NAME
thai/thcell.h -
Thai string cell custering.
SYNOPSIS
Data Structures
struct thcell_t
Thai char cell representation.
Functions
void th_init_cell (struct thcell_t *cell)
Initialize a Thai cell.
size_t th_next_cell (const thchar_t *s, size_t len, struct thcell_t *cell, int is_decomp_am)
Get first cell from string.
size_t th_prev_cell (const thchar_t *s, size_t pos, struct thcell_t *cell, int is_decomp_am)
Get previous cell from string.
size_t th_make_cells (const thchar_t *s, size_t len, struct thcell_t cells[], size_t *ncells, int is_decomp_am)
Tokenize string into cells.
Detailed Description
Thai string cell custering.
Function Documentation
void th_init_cell (struct thcell_t *cell)
Initialize a Thai cell.
Parameters:
cell : pointer to the cell to initialize
Initializes values in the Thai cell struct.
size_t th_make_cells (const thchar_t *s, size_tlen, struct thcell_tcells[], size_t *ncells, intis_decomp_am)
Tokenize string into cells.
Parameters:
s : the string
len : the length of string
cells : the array of output cells buffer
ncells : the address of integer storing the number of cells provided by the buffer, and to keep the number of resulting cells on return
is_decomp_am : whether SARA AM is to be decomposed into NIKHANIT and SARA AA and to be in separate cells
Returns:
total characters consumed
Tokenizes the string bounded by s and len into cells, and stores at most *ncells resulting cells in the cells buffer. On return, *ncells is
also set to the total cells stored in cells[].
size_t th_next_cell (const thchar_t *s, size_tlen, struct thcell_t *cell, intis_decomp_am)
Get first cell from string.
Parameters:
s : the string
len : the length of string
cell : the output buffer
is_decomp_am : whether SARA AM is to be decomposed into NIKHANIT and SARA AA and to be in separate cells
Returns:
total chars consumed by the cell
Gets first cell from the string bounded by s and len, and, if cell is not null, stores the cell data in it.
size_t th_prev_cell (const thchar_t *s, size_tpos, struct thcell_t *cell, intis_decomp_am)
Get previous cell from string.
Parameters:
s : the string
pos : the position in string to get cell previous to
cell : the output buffer
is_decomp_am : whether SARA AM is to be decomposed into NIKHANIT and SARA AA and to be in separate cells
Returns:
total chars consumed by the cell
Gets last cell from the string bounded by s and pos, and if cell is not null, stores the cell data in it.
Author
Generated automatically by Doxygen for libthai from the source code.
Version 0.1.14 Tue Jun 17 2014 thai/thcell.h(3)