Hi Everyone,
I have a program that opens a fixed width text file, and i assign values to variables based on the position. I then print the values back to a second text file, and put in a delimiter.
Here is my code below:
Open txtfilename For Input As #1
Open txtfilename & ".new" For Append As #2
Do Until EOF(1)
Line Input #1, Data
strTDeedNum = Left(Data, 11)
strTDEEDTYPE = Trim(Mid(Data, 12, 40))
strTGFName = Trim(Mid(Data, 52, 20))
Print #2, strDeedNum & "|" & strDEEDTYPE
Loop
close #1
Close #2
How do I make it so that if a variable is empty, I don't print it back to the new text file.
I am printing all values on one line.
Please help.
I have a program that opens a fixed width text file, and i assign values to variables based on the position. I then print the values back to a second text file, and put in a delimiter.
Here is my code below:
Open txtfilename For Input As #1
Open txtfilename & ".new" For Append As #2
Do Until EOF(1)
Line Input #1, Data
strTDeedNum = Left(Data, 11)
strTDEEDTYPE = Trim(Mid(Data, 12, 40))
strTGFName = Trim(Mid(Data, 52, 20))
Print #2, strDeedNum & "|" & strDEEDTYPE
Loop
close #1
Close #2
How do I make it so that if a variable is empty, I don't print it back to the new text file.
I am printing all values on one line.
Please help.