Orchestrator içerisinde kullanacağımız tüm verileri otomatik olarak bir yerden okumak isteriz. Gerek csv gerekse txt dosyaları gibi dosya türlerini data okumak için kullanabilirsiniz.
Burada en önemli sorun datayı convert etmektir. Biz buna Data Manipulation diyoruz. Örnek vermek gerekirse bir txt dosyasının içeriği aşağıdaki gibi;
Adi,Soyadi,LoginName,Sifre,Telefon
Mustafa,kasikci,Mustafa.KaSikCI,Deneme123,05358171200
Yukarıdaki txt file içeriğine göre Benim kullanmak istediğim alan Deneme123 yazan yer yani virgülden sonraki 3. Alan oluyor. Bunu ben Orchestrator içerisinde kullanmak için ne yaparım? Bu sorunun cevabı aşağıdaki gibi;
Sifre : [Field({publisheddata},’,’,3)]
Resim-1
Buna benzer diğer manipulation metopları aşağıdaki tabloda yer almaktadır. Örnek Tümünü büyüt; tümünü küçült gibi fonksiyonlarıda kullanabilirsiniz. Resimde Soyadı satırındaki alandan gelen değer komple büyütülmüş olarak yazılacaktır. LoginName alanı ise komple küçültülerek yazılacaktır. İşlemin çıktısı aşağıdaki gibidir;
Resim-2
Bu yöntemi kullanmasaydınız txt içerisindeki alanı komple olarak okuyacaktınız yani (Mustafa,kasikci,Mustafa.KaSikCI,Deneme123,05358171200) bu şekilde görecektiniz.
Kullanılabilir Data Manipulation Tablosu
Functions
Functions are case-sensitive. For example, Upper(‘Text’) will be processed, but upper(‘Text’) will not.
Function and Definition | Usage | Parameters | Example |
Upper – converts text to uppercase. | Upper(‘Text’) | Text – the text that is being converted to uppercase. | Upper(‘this will be converted to uppercase’) returns ‘THIS WILL BE CONVERTED TO UPPERCASE’ |
Lower – converts text to lowercase. | Lower(‘Text’) | Text – the text that is being converted to lowercase. | Lower(‘This Will Be Converted To Lowercase’) returns ‘this will be converted to lowercase’ |
Field – returns text in a specific position. | Field(‘Text’, ‘Delimiter’, Field Number) | Text – the text that is being searched.
Delimiter – the character that separates each field. Field Number – the position of the field that is being returned (starting at 1). |
Field(‘John;Smith;9055552211’, ‘;’, 2) returns ‘Smith’ |
Sum – returns the sum of a set of numbers. | Sum(firstNumber, secondNumber, thirdNumber, …) | Number – the number that is being added. You can put any set of numbers, each separated by a comma (,). | Sum(2,3,4,5) returns ’14’ |
Diff – returns the difference of two numbers. | Diff(Number1, Number2, <Precision>) | Number1 – the number that will be subtracted from.
Number2 – the number that will be subtracted from Number1. Precision <Optional> – the number of decimal places that the result will be rounded to. |
Diff(9, 7) returns ‘2’
Diff(9.3, 2.1, 2) returns ‘7.20’ |
Mult – returns the product of a set of numbers. | Mult(firstNumber, secondNumber, thirdNumber, …) | Number – the number being multiplied. You can put any set of numbers, each separated by a comma (,). | Mult(2, 3, 4) returns ’24’ |
Div – returns the quotient of two numbers. | Div(Number1, Number2, <Precision>) | Number1 – the number that will be divided.
Number2 – the number that will divide Number1. Precision <Optional> – the number of decimal places that the result will be rounded to. |
Div(8, 4) returns ‘2’
Div(9, 2, 2) returns ‘4.50’ |
Instr – returns the position of first occurrence of text within another text. | Instr (‘SearchText’, ‘TextToFind’) | SearchText – the text that is being searched.
TextToFind – the text that you are searching for. |
Instr(‘This is a string that is searched’, ‘string’) returns 11 |
Right – returns a subset of the text from the right side of the full text. | Right(‘Text’, Length) | Text – the full text.
Length – the number of characters from the right side that will be returned. |
Right(‘Take from the right’, 9) returns ‘the right’ |
Left – returns a subset of the text from the left side of the full text. | Left(‘Text’, Length) | Text – the full text.
Length – the number of characters from the left side that will be returned. |
Left(‘Take from the left’, 4) returns ‘Take’ |
Mid – returns a subset of the text from the middle of the full text. | Mid(‘Text’, Start, Length) | Text – the full text.
Start – the starting position in the text where you want to begin returning characters. Length – the number of characters starting from the Start position that will be returned. |
Mid(‘Take from the middle’, 5, 4) returns ‘from’ |
LTrim – trims leading spaces from text. | LTrim(‘Text’) | Text – the text that is being trimmed of leading spaces. | LTrim(‘ Remove the leading spaces only. ‘) returns ‘Remove the leading spaces only. ‘ |
RTrim – trims the trailing spaces from text. | RTrim(‘Text’) | Text – the text that is being trimmed of trailing spaces. | RTrim(‘ Remove the trailing spaces only. ‘) returns ‘ Remove the trailing spaces only.’ |
Trim – trims leading and trailing spaces from text. | Trim(‘Text’) | Text – the text that is being trimmed. | Trim(‘ Remove leading and trailing spaces. ‘) returns ‘Remove leading and trailing spaces.’ |
Len – returns the length of text. | Len(‘Text’) | Text – the text that is being measured. | Len(‘Measure this text’) returns 17 |
Tablo-1
Microsoft sayfasında yer alan fonksiyonları görmek için;
http://technet.microsoft.com/en-us/library/hh440537.aspx
Bu konuyla ilgili sorularınızı alt kısımda bulunan yorumlar alanını kullanarak sorabilirsiniz.
Referanslar