Hi Guys,
I have a routine which breaks a file in to two.
When i run the routine it says "error reading file".
On further investigation i found that there are two empty strings in the middle of the data file which is thowing this error........
Please have a look at the code below
Code:
******* Skip first few records to get to get to the column headings
skip=@true
Loop While skip
ReadSeq Rec from File
Then
Irec=Field(iRec,',',1,4)
If Irec='Date,Site,Placement,Name' Then
skip=@false
End
End
Else
Call DSLogFatal("Error reading file...":Arg1,"JobControl")
GoTo ErrorExit
End
Repeat
***************************************************
so in between the data there are two empty strings with out the delimiters.
I am not able to figure out how to skip those two lines.....
If some body has any idea how to read those lines so that i can skip them,..
Thanks in advance
S
Error while reading a csv file
Moderators: chulett, rschirm, roy
-
ray.wurlod
- Participant
- Posts: 54595
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Code: Select all
If Trim(Rec) <= " " Then ContinueIBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.