Sponsored Content
Top Forums UNIX for Dummies Questions & Answers How to add comma after every value in a array Post 302699255 by itkamaraj on Tuesday 11th of September 2012 10:04:53 AM
Old 09-11-2012
Code:
$ for var1 in a b c d e f; do echo $var1; done
a
b
c
d
e
f
$ for var1 in a b c d e f; do final=${final}","${var1}; done
$ echo $final
,a,b,c,d,e,f

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Add a comma at end of every line

hello A small shell scripting help.. I have a file say with 5 lines of text (text file). At the end of everyline I need to add a comma at the end of the file. Thanks, ST2000 (4 Replies)
Discussion started by: ST2000
4 Replies

2. UNIX for Dummies Questions & Answers

add comma

I have a file like this 101223345 23232344a 1312a3441 903821224 143434324 101223345 23232344a 1312a3441 I want to insert comma in 5 digit. it should be like 10122,3345 23232,344a how can I do this ? thanks Alice... (3 Replies)
Discussion started by: alisevA3
3 Replies

3. Shell Programming and Scripting

Splitting comma separated values into an array

I'm attempting to create a KSH array out of a string like this: ",,,value1,value2,," I have created the array but I only get two elements, one for value1 and one for value2. I have ended up with something like this but I don't like it: set -A JUNK xx=0 for i in $(print ",,,value1,value2,,"... (3 Replies)
Discussion started by: tmarikle
3 Replies

4. UNIX for Dummies Questions & Answers

Loading a comma Delimited file into an Array

Hello, I have been stuck on this aspect of loading a comma delimited file into an array. I thought i had the syntax right, but my commands are not working the way I want them to. Basically my cut command is splitting the file up by spaces and commas. I want the cut command to ignore white spaces.... (2 Replies)
Discussion started by: grandtheftander
2 Replies

5. UNIX for Dummies Questions & Answers

Add comma to integer using AWK

Srr for being pain her let say i have a data in a file like this 1@1000 2@2000 4@4000 5@7770 6@8998 7@80008 i am a newbie in Unix i need to add a comma to integer using AWK function. for example, 1,000 or 80,008 how can i do that ps. i'm using bash shell (1 Reply)
Discussion started by: Nutter
1 Replies

6. Shell Programming and Scripting

Assigning Multiple Comma Separated IP's To A Bash Array

I am in the process of creating a BASH shell scripts for a project at work. So the scenario is as such: I have a file with each line entry separated by ':' ... (3 Replies)
Discussion started by: metallica1973
3 Replies

7. Shell Programming and Scripting

Use sed to add comma to end of first field

Example data Gi1/10 Gi1/12 xl32lytscb07 3/11 to nyc 3/12 41764 ecomm 3/13 hxcsxsa 2/1 3/14 ziim570-rsvd 3/15 xl3NDSADM Po1 VPC trunk to xl3-i Po2 ***DO NOT ENABLE** Po13 *** VPC link to Po101 Po102 xl3-2lyg1accsgh-fe... (7 Replies)
Discussion started by: sumguy
7 Replies

8. Shell Programming and Scripting

How to extract field delimited by comma and store into an array?

hi, i have a variable which contains some file names separated by comma. example FNAME="abc.txt,def.txt,ghi.txt" i want to extract each filename and store it into an array and also count the number of files in the array. file=abc.txt file=def.txt file=ghi.txt i thought of using the... (8 Replies)
Discussion started by: Little
8 Replies

9. Shell Programming and Scripting

sed add double quotes and comma

Hi, 00000119EEEC3F25 feedoor 20171103 0000011A4F152077 feedard 20171024 00000191FA295F61 feedzipperhola 20171023 00000213C57BB856 feedriodapple 20171005 0000025F778EF9D5 joobakoolrk 20171004 I needed the result as: "00000119EEEC3F25", "feedoor", ... (9 Replies)
Discussion started by: ashokvpp
9 Replies

10. Shell Programming and Scripting

awk to parse comma separated field and removing comma in between number and double quotes

Hi Experts, Please support I have below data in file in comma seperated, but 4th column is containing comma in between numbers, bcz of which when i tried to parse the file the column 6th value(5049641141) is being removed from the file and value(222.82) in column 5 becoming value of column6. ... (3 Replies)
Discussion started by: as7951
3 Replies
IMAGE_TO_J2K(1) 						  OPENJPEG TOOLS						   IMAGE_TO_J2K(1)

NAME
image_to_j2k - convert a PNM, PGM, PPM, PGX or BMP into a J2K or JP2 file SYNOPSIS
DESCRIPTION
image_to_j2k converts an image into a JPEG 2000-encoded image OPTIONS
-ImgDir sourcedir Directory of PGM, PPM, PNM, PGX or BMP files to convert -OutFor extension J2K or JP2 output file format -i source PNM, PGM or PPM file to convert -o destination J2K or JP2 file to output to -h Display help information -cinema2k fps Digital Cinema 2K profile compliant codestream for 2K resolution. 24 or 48 fps. -cinema4k [fps] Digital Cinema 4K profile compliant codestream for 4K resolution. fps default is 24 -r ratios compression factor for successive layers, comma seperated -q psnr psnr for successive layers, comma seperated -n rescount number of resolutions -b blocksize width and height of code block, comma-seperated -c precintsize width and height of precinct, comma-seperated -t tilesize width and height of tile, comma-seperated -p progression progression order, one of LRCP, RLCP, RPCL, PCRL, CPRL -s subsampling subsampling factor in X and Y, comma-seperated. Values larger than 2 can produce errors -POC orders progression order change -SOP write SOP marker before each packet -EPH write EPH marker after each header packet -M modeflags Sum of the values of the modes, as follows: 1. BYPASS (LAZY) 2. RESET 4. RESTART (TERMALL) 8. VSC 16. ERTERM (SEGTERM) 32. SEGMARK (SEGSYM) -x indexfile create an index file -ROI:quantize quantization indices upshifted for component c between 0 and 2 inclusive with an upshift of U between 0 and 37 inclusive -d imageoffset X and Y offset of the origin of the image, comma-seperated -T tileoffset X and Y offset of the origin of the tiles, comma-seperated -I use the irreversible DWT 9-7 EXAMPLE
ratios: 20,10,1 Quality 1: compress 20x; Quality 2: compress 10x; Quality 3: lossless compression psnr: 30,40,50 quantize: c=0,U=25 orders: T1=0,0,1,5,3,CPRL Title 1: Resolution 0 start, component 0 start, layer 1 end, resolution 5 end, component 3 end, CPRL progression AUTHOR
Written by Paul Hampson <Paul.Hampson@Pobox.com> based on the output of image_to_j2k -h as part of the Debian packaging of OpenJPEG COPYRIGHT
Copyright 2007 Paul Hampson SEE ALSO
j2k_to_image(1), <http://www.openjpeg.org/index.php?menu=doc#encoder> 1.3+dfsg 2014-04-22 IMAGE_TO_J2K(1)
All times are GMT -4. The time now is 03:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy