Print next line uipath

hello guys, do u know how to print next line?
image
the right output is on notepad
thank you

@Aluneth_X

Use Environment.NewLine or vbCrLf to print next line.

2 Likes

next line sir not new line
Environment.NewLine or vbCrLf this is for enter

@Aluneth_X

use vbLf and try once.

image
it doesn’t work

@Aluneth_X

It prints next line right. What else you want ?

@Aluneth_X After reading text file assume in the output V1 replace new line with null.

V1=V1.Replace(System.Environment.NewLine, " ")

it should be 0.025 MT
not
0.025

MT

@Aluneth_X

Could you please show me some sample input and output for better understanding.

this is input

and this is output
image

the expected result is this
image

@Aluneth_X Replace newline with null

@Aluneth_X

I asked input text and but not the expression you tried. From where you are getting this input ?

i get this input from excel using readrange and readcell

Hi @Aluneth_X
Can you show us how the value is in the cell that you read? Read it and output a message box and show what the exact value is so that we can decide the best way to convert it to your required output

Hello @Aluneth_X
you can use VariableName.Replace(vbCrLf," ") to replace all the new line with space so your output will be like this
PP Grade CP90NK blablablabla 0.025 MT @IDR 18150000 /MT
but as show in the image you want all the text after blablabla to be under next line so for that you can Split the data using this regex split method
System.Text.RegularExpressions.Regex.Split(NLStr,cstr(“((\d.).+)”))
this will split the data from and you’ll get array of string and for the final output you can use this
ArrofString(0)+vbcrlf+ArrOfString(1)
To get output like this
PP Grade CP90NK blablablabla
0.025 MT @IDR 18150000 /MT

Check this workflow for better Understanding
OneWaytosplitRegex.xaml (5.9 KB)

2 Likes

thank u sir

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.