Sponsored Content
Top Forums Shell Programming and Scripting Help with String concatenation Post 302829479 by PreetArul on Friday 5th of July 2013 04:53:09 AM
Old 07-05-2013
Thanks, You are right

when I run the script via sh -x, I find \r after the value and that is causing the problem.

Due to \r it is unable to suffix .ext.sent

Could you suggest how to remove that.

Thanks,
Preeti
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

string concatenation

my input file contains thousands of lines like below 234A dept of education 9788 dept of commerce 8677 dept of engineering How do i add a delimeter ':' after FIRST 4 CHARACTERS in a line 234A:dept of education 9788:dept of commerce 8677:dept of engineering (7 Replies)
Discussion started by: systemsb
7 Replies

2. Shell Programming and Scripting

Help concatenation string and variable

Hello, in my script i have this lines of code in a while cycle: .. let j=i+1 t_prod_$i = `cat myfile.csv | grep world | cut -d ";" -f$j` let i+=1 ... So if i try an echo $t_prod_$i at the end of the cycle i cannot see the right value obtained by `cat myfile.csv | grep world |... (5 Replies)
Discussion started by: drain
5 Replies

3. Shell Programming and Scripting

String concatenation with spaces

Hi, I have a variable $ID=40 and I need to build a string like 40 40 40 40 40 40 so repeating ID 'n' times separated by spaces. Any help? Thanks Sarah (2 Replies)
Discussion started by: f_o_555
2 Replies

4. Shell Programming and Scripting

String Concatenation

Hi All, I need to concatenate the values in the array into a variable. Currently the code is : for (( i=1 ; i <= $minCount ; i++ )) do var="${var}""${sample_file}" done The output is : /tmp/1/tmp/2/tmp/3/tmp/4/tmp/5/tmp/6/tmp/7/tmp/8/tmp/9/tmp/10 I need a space between... (1 Reply)
Discussion started by: sh_kk
1 Replies

5. Shell Programming and Scripting

String/Variable Concatenation

Hello, Trying to concatenate the following using bourne shell: # !/bin/bash # this works in bash shell e.g. get the results I am expecting fnTmp=C$cindex.$station_0.$station_1.$station_3.$ts.tmp # # under !/bin/sh # the results are not the same Any assistance would be... (8 Replies)
Discussion started by: LAVco
8 Replies

6. Shell Programming and Scripting

String concatenation problems

#! /bin/csh set tt=12345_UMR_BH452_3_2.txt set rr=`echo $tt | cut -d_ -f1` set rr1=welcome set ff=$rr $rr1 echo $ff why $ff returned only 12345 and not 12345welcome? thanks (2 Replies)
Discussion started by: jdsignature88
2 Replies

7. Shell Programming and Scripting

String / Variable Concatenation

Hi all, I'm trying to build a variable name automatically through a for loop for a script I'm working on, basically I want to build the variables named: $JVM_HOME0 or $JVM_HOME1 so that I can loop through some file copy/deletes and a server restart once completed. With the code below, I get this... (3 Replies)
Discussion started by: hydroponx
3 Replies

8. Shell Programming and Scripting

String concatenation

Hi, I have two files. cat file.txt a b c d cat file1.txt j k l m I need the output as a:j (12 Replies)
Discussion started by: nareshkumar522
12 Replies

9. Shell Programming and Scripting

String concatenation problem

Hi there, I'm writing a basic script where I want to make a string of 2 numeric fields from a file, which I have done, but the behavior is rather confusing. I have a file of random values such as: 1 2 3 4 5 6 7 8 9 10 and my awk code is: BEGIN { FS = " " } { str = str $1 $2 } END {... (7 Replies)
Discussion started by: HMChadwick
7 Replies

10. Shell Programming and Scripting

Group by and string concatenation

Hi, I was trying to work on a file which had the following data format 1 hi 1 this 1 is 1 john 2 hello 3 test 3 case the expected output file is the below 1 hi, this, is, john 2 hello 3 test, case I tried using awk or while read, but I couldnt... (13 Replies)
Discussion started by: karthikbhuvana
13 Replies
MINCCONCAT(1)							 MINC User's Guide						     MINCCONCAT(1)

NAME
mincconcat - concatenate minc files along a specific dimension SYNOPSIS
mincconcat [<options>] <infile1>.mnc [<infile2>.mnc ...] <outfile>.mnc DESCRIPTION
Mincconcat will concatenate a number of minc files together, producing a single output file. The concatenation is done along a specified dimension, with the slices being sorted into ascending order. The concatenation dimension can either be a dimension in the file, in which case coordinates for sorting are taken directly from the input files, or it can be a new dimension and the coordinates are specified with a command-line option. OPTIONS
Note that options can be specified in abbreviated form (as long as they are unique) and can be given anywhere on the command line. General options -2 Create a MINC 2.0 format output file. -clobber Overwrite an existing file. -noclobber Don't overwrite an existing file (default). -verbose Print out progress information for each chunk of data copied (default). -quiet Do not print out progress information. -max_chunk_size_in_kb size Specify the maximum size of the copy buffer (in kbytes). Default is 4096 kbytes. -filelist filename Specify a file containing a list of input file names. If "-" is given, then file names are read from stdin. If this option is given, then there should be no input file names specified on the command line. Empty lines in the input file are ignored. Output type options -filetype Don't do any type conversion (default). -byte Write out 8-bit integer voxels. -short Write out 16-bit integer voxels. -int Write out 32-bit integer voxels. -long Superseded by -int. -float Write out single-precision floating point values. -double Write out double-precision floating point values. -signed Write out values as signed integers (default for short and long). Ignored for floating point types. -unsigned Write out values as unsigned integers (default for byte). Ignored for floating point types. -valid_range min max Specifies the valid range of output voxel values in their integer representation. Default is the full range for the type and sign. This option is ignored for floating point values. Concatenation options -concat_dimension name Specifies the name of concatenation dimension. If the dimension exists in the input files, then coordinates are taken from those files. If not, then a new dimension is created and the coordinate for each input file is taken from command-line options. The default is to use the slowest varying dimension of the first file. -start start Specifies the starting coordinate for the new dimension (default = 0.0). -step step Specifies the separation between voxels for the new dimension (default = 1.0). -width width Specifies the (constant) width of each sample along the new dimension (default = none). -coordlist c1,c2,... Specifies a comma-separated list of coordinates along the new dimension. -widthlist w1,w2,... Specifies a comma-separated list of widths along the new dimension. -filestarts s1,s2,... Specifies a comma-separated list of offsets to the coordinate origins for each of the files listed on the command line. This option is useful for concatenating files along an existing dimension, for example for concatenating multiple functional runs along a time dimension. -check_dimensions Check that all input files have matching sampling in world dimensions (default). -nocheck_dimensions Ignore any differences between input files in world dimensions sampling. -ascending Sort coordinates in ascending order (default). -descending Sort coordinates in descending order. -interleaved Sort slabs by their dimension coordinate, interleaving if necessary (default). -sequential Don't sort slabs, just concatenate them together. WARNING - this will destroy the dimension information along the concatenating dimension, replacing the start and step with zero and one. Generic options for all commands: -help Print summary of command-line options and exit. -version Print the program's version number and exit. EXAMPLES
To concatenate two volumes with dimensions zspace, yspace, xspace, having interleaved slices along zspace, we can simply use mincconcat input1.mnc input2.mnc output.mnc If we have a bunch of compressed (yspace, xspace) images that we wish to concatenate into an evenly spaced volume, then we can type mincconcat input1.mnc.gz input2.mnc.gz input3.mnc.gz input4.mnc.gz output.mnc -concat_dimension zspace -start -23 -step 2 AUTHOR
Peter Neelin COPYRIGHTS
Copyright (C) 1995 by Peter Neelin $Date: 2005-07-15 17:38:08 $ MINCCONCAT(1)
All times are GMT -4. The time now is 02:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy