Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27513

VS 2010 Split file & add extra line

$
0
0
Hi guys!

Another small problem, I will try to explain it at best.
I am creating a small program to add a string of text after a type of word has been found. But the string gets placed in a new line above the line instead of under.

What I get:
Code:

.............................
REF: X0.000 Y1078.000 S0.00 ;    C:\Salvagnini\syscon\S4_1387/production/20_4_stock_profielen/20_4_stock_profielen_139x3000.S4
REF: X0.000 Y0.000 S0.00
;
;        Parts
;
SEQ ; -->> Start unload sequence <<--
test
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y105.000 U3000.000 V139.000 J1
test
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y244.000 U3000.000 V139.000 J2
test
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y383.000 U3000.000 V139.000 J3
test
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y522.000 U3000.000 V139.000 J4
test
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y661.000 U3000.000 V139.000 J5
test
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y800.000 U3000.000 V139.000 J6
test
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y939.000 U3000.000 V139.000 J7
test
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y1078.000 U3000.000 V139.000 J8
ESQ ; -->> End unload sequence <<--
;
;        Filling scraps
;
PIE: X0.000 Y0.000 U3000.000 V105.000 J-1 DES DWN SCR
..................

What I need:

Code:

REF: X0.000 Y1078.000 S0.00 ;    C:\Salvagnini\syscon\S4_1387/production/20_4_stock_profielen/20_4_stock_profielen_139x3000.S4
REF: X0.000 Y0.000 S0.00
;
;        Parts
;
SEQ ; -->> Start unload sequence <<--
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y105.000 U3000.000 V139.000 J1
test
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y244.000 U3000.000 V139.000 J2
test
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y383.000 U3000.000 V139.000 J3
test
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y522.000 U3000.000 V139.000 J4
test
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y661.000 U3000.000 V139.000 J5
test
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y800.000 U3000.000 V139.000 J6
test
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y939.000 U3000.000 V139.000 J7
test
PIE: "20_4_stock_profielen_139x3000.S4" X0.000 Y1078.000 U3000.000 V139.000 J8
test
ESQ ; -->> End unload sequence <<--
;
;        Filling scraps
;
PIE: X0.000 Y0.000 U3000.000 V105.000 J-1 DES DWN SCR

My code (short! :D)

Code:

        Dim stackerfile As String
        stackerfile = My.Computer.FileSystem.ReadAllText("C:\test.txt")
        TextBox1.Text = stackerfile
        Dim stackerfilesplit As String = TextBox1.Text
        Dim someArray As Array = Split(stackerfilesplit, "PIE: " & Chr(34))
        For i As Integer = 0 To someArray.Length - 1
            TextBox2.Text = TextBox2.Text & "PIE: " & Chr(34) & (someArray(i).ToString) & "test" & vbNewLine
        Next

I tried to change the "test" part before, after, under, etc etc in the last line to get it right, but doesn't work.. I haven't got the "vision" in code like most of you :)

Thanks a lot!!!

Viewing all articles
Browse latest Browse all 27513

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>