lklo
Industrial
- Nov 24, 2010
- 226
Hi
Can anyone here explain me , how I can search i a TXT file (VB.net) ,
I know how to open with streamreader and so on , also to write or append to it.
But I need a code to search in file, for example at XTB or ZBTFG1102, and then store the entire line in a variable.
and next trim the variable until filepath start: U:\......
So the variable only contains the filepath.
Can anyone help me ?
lkl
txtfile:
7006.01.008.01 xtb -/20100377 U:\ugi\Arda\ADH-Diverse\Gru7008\gr03\Styr+Bosning\7002.07.001.01_teg.prt
7006.01.004.02 larsklok -/20100347 U:\ugi\Arda\ADH-Diverse\Gru7008\gr03\Styr+Bosning\7005.04.001.01_teg.prt
7006.01.004.01 zbtf1201 -/20111107 U:\ugi\Arda\ADH-Diverse\Gru7008\gr03\Styr+Bosning\7001.04.001.01_teg.prt
7008.03.002.01 ZNNOFGHOQAREGV -/20120301 U:\ugi\ArdA\ADH-Diverse\Gru7008\gr03\Styr+Bosning\7008.03.002.01_teg.prt
7008.03.001.01 ZBTFG1102 /20120307 U:\ugi\Arda\ADH-Diverse\Gru7008\gr03\Styr+Bosning\7008.03.001.01_teg.prt
Can anyone here explain me , how I can search i a TXT file (VB.net) ,
I know how to open with streamreader and so on , also to write or append to it.
But I need a code to search in file, for example at XTB or ZBTFG1102, and then store the entire line in a variable.
and next trim the variable until filepath start: U:\......
So the variable only contains the filepath.
Can anyone help me ?
lkl
txtfile:
7006.01.008.01 xtb -/20100377 U:\ugi\Arda\ADH-Diverse\Gru7008\gr03\Styr+Bosning\7002.07.001.01_teg.prt
7006.01.004.02 larsklok -/20100347 U:\ugi\Arda\ADH-Diverse\Gru7008\gr03\Styr+Bosning\7005.04.001.01_teg.prt
7006.01.004.01 zbtf1201 -/20111107 U:\ugi\Arda\ADH-Diverse\Gru7008\gr03\Styr+Bosning\7001.04.001.01_teg.prt
7008.03.002.01 ZNNOFGHOQAREGV -/20120301 U:\ugi\ArdA\ADH-Diverse\Gru7008\gr03\Styr+Bosning\7008.03.002.01_teg.prt
7008.03.001.01 ZBTFG1102 /20120307 U:\ugi\Arda\ADH-Diverse\Gru7008\gr03\Styr+Bosning\7008.03.001.01_teg.prt