Sheet name modification

i have input sheet name in config file as Pous_CK_1000002_$2345.csv

i want to take only this Pous_CK_ so that i can make it dynamic

sheet from config file is in_config(“InputsheetName”).tostring

hi @T_Y_Raju
Pous_CK_1000002_$2345.csv what is the fixed of this ?

This is fixed Pous_CK_

you are saying you want the fixed part !!

yes i want the fixed part

split(“Pous_CK_1000002_$2345.csv”,“10”)(0)

but its fixed !
why you want the fixed part !

like i will be getting input files with same name as Pous_ck_with different numeric value

so every time i want the sheet name to standardized

in_config(“Inputsheetname”).tostring.subtring(0,7) this method is not working

@T_Y_Raju
try
Split("Pous_CK_1000002_$2345.csv","Pous_CK_1000002_$2345.csv".split("_"c)(2).tostring)(0)

replace “Pous_CK_1000002_$2345.csv” with
in_confg(“Inputsheetname”).tostring

Hi @T_Y_Raju

Try this

variable = in_config(“InputsheetName”).tostring

RequiredData = variable.split("_"c)(0)+"_"+variable.split("_"c)(1)+"_"

Regards

Hi @T_Y_Raju

Try this

FileName.Substring(0,8)

I hope it helps!!

my sheet name in config file is Pous_CK_10000034_$1234.15.csv

iam writing expression as in_config(“inputsheetname”.substring(0,7).tostring

its giving error as cannot assign system.object to type system,string

Hi @T_Y_Raju

Give like this
in_Config(“inputsheetname”).ToString.SubString(0,8)

Hi @T_Y_Raju

Use the below regex expression to extract the desired output

System.Text.RegularExpressions.Regex.Matches(yourstringinput.ToString,“(.*\_(?=.*\_.*.csv))”)

image

Hi @T_Y_Raju

Store the value to a variable and try giving

variable = in_config(“InputsheetName”).tostring

RequiredData = variable.substring(0,8)

Regards

it says index and length must refer to a location with in string
parameter name:length

Hi @T_Y_Raju

Try using the following regex expression:

System.Text.RegularExpressions.Regex.Match("Pous_CK_1000002_$2345.csv","[A-Za-z]+_+[A-Z]+_").Value

Hope it helps!!
Regards,

@T_Y_Raju

Try to store config value in a variable by using assign activity

- Assign -> variable = in_config(“InputsheetName”).tostring
- Assign -> Output = Variable.SubString(0,8)

how to use this function