Click here to Skip to main content
15,867,835 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
i want to display the name and ticket number in gridview from text file
text file is shown below:
and the text i want to display in gridview are bold
CSS
AMD 1200059923;1/1;
GW2195817;GW2199286
MUC1A 8I8DEC008;0202;TIPLY2499;;TIPLY2499;;TIPLY2499;;TIPLY2198;45210620;;;;;;;;;;;;;;;;;;;;;;TU 8I8DEC
A-TUNISAIR;TU 1993
B-TTP/T-TU/RT
C-7906/ 0002BBSU-6864MHGS-I-0--
D-130612;130612;130612
G-X  ;;TIPTIP;
H-001;003OTIP;TRIPOLI          ;TUN;TUNIS            ;TU    0418 C C 16JUN1525 1535 16JUN;OK02;HK02;;0;320;;;30K;;;ET;0110 ;N;333;LY;TN;M
H-002;004OTUN;TUNIS            ;TIP;TRIPOLI          ;TU    0413 C C 23JUN1725 1930 23JUN;OK02;HK02;;0;320;;;30K;M ;;ET;0105 ;N;333;TN;LY;
K-FLYD316.000    ;;;;;;;;;;;;LYD380.300    ;;;
KFTF; LYD14.000   YQ AC; LYD25.600   YR VB; LYD6.000    WV DP; LYD1.000    LY EM; LYD15.000   RL EB; LYD2.700    RK SE;;;;;;;;;;;;;;;;;;;;;;;;
L-
M-CRT1           ;CRT1
N-NUC123.47;123.47
O-XXXX;XXXX
Q-TIP TU TUN123.47TU TIP123.47NUC246.94END ROE1.279640;FXB
I-002;01AMEL/EISA MRS;;APTIP 218 0217139999/ - SAFER AL-LHUDA FOR TRAVAL - A//E-M.HAMODA@TRIPOLISAIL.COM;;
T-K199-2403526410
FM*M*7
FPCASH
FVTU;S3-4;P1-2
TKOK12JUN/TIPLY2499
RM*BR2
RM*AN0217139999
I-001;02ETOMUI/KHALED MR;;APTIP 218 0217139999/ - SAFER AL-LHUDA FOR TRAVAL - A//E-M.HAMODA@TRIPOLISAIL.COM;;
T-K199-2403526411
FM*M*7
FPCASH
FVTU;S3-4;P1-2
TKOK12JUN/TIPLY2499
RM*BR2
RM*AN0217139999
RIZSAFEER ALHUDA AGENCY
ENDX


please someone help me
Posted
Updated 15-Jun-13 13:42pm
v2
Comments
[no name] 15-Jun-13 20:28pm    
Okay and so what is the question and/or problem?
jkirkerx 16-Jun-13 0:02am    
Passenger names start with I, and is the 2nd comma delimited field on the line.

So you read the file, you can convert it to bytes, and separate the lines by detecting the LF or CR chars, and convert it into an array of lines, then parse the array, and extract the data your looking for.

There are several ways to do it, but open and read the file first.
veezo 16-Jun-13 0:10am    
i know the code to open and read the file which is shown below
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
' Declarations
Dim objStreamReader As New StreamReader(Server.MapPath("TextFile.txt"))
Dim arrText As New ArrayList

' Loop through the file and add each line to the ArrayList
Do While objStreamReader.Peek() >= 0
arrText.Add(objStreamReader.ReadLine)
Loop

' Close the reader
objStreamReader.Close()

' Bind the results to the GridView
GridView1.DataSource = arrText
GridView1.DataBind()
End Sub

now this code give me all the lines in one column of grdiview can u give me the code about what u r saying...? please its really very important

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900