INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

csv file breaking after numeric characters and special characters

csv file breaking after numeric characters and special characters

csv file breaking after numeric characters and special characters

(OP)
The plan

1 Access Database creates a csv file
2 Data is read by Reflections 2011 VBA code
3 Data is passed to the mainframe via Reflections 2011 VBA

The problem

1 Access Database creates the csv file (NO PROBLEM)
2 Data is read by Reflections 2011 VBA code (PROBLEM)

A) If leading numeric number, anything on the string following the digits would no be on the output. All information is passed via variables
Example: Input via csv file "3rd Floor". The output would be "3"
Example 2: Input via csv file "The 3rd Floor". The output would be "The 3"

B) If special characters, anything on the string following the character would no be on the output. All information is passed via variables
Example: Input via csv file "The_Floor". The output would be "The"
Example 2: Input via csv file "The_Upper_3rd_Floor". The output would be "The"

3 Data is passed to the mainframe via Reflections 2011 VBA (NO PROBLEM)

Questions

1 Why is numeric and special characters breaking up the string?
2 Is there a way to avoid the break up?
3 Any alternatives?

Thank You

RE: csv file breaking after numeric characters and special characters

Hi,

Where is the Reflections 2011 VBA code?

Please post.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: csv file breaking after numeric characters and special characters

(OP)
Sub FBI_RA_BOOKING()

Dim hostSettleTimeout As Integer
Dim hostSettleTime As Integer
Dim osCurrentScreen As Screen
Dim osCurrentTerminal As Terminal
Dim returnValue As Integer
Dim hiddenTextEntry As String

hostSettleTimeout = 5000
hostSettleTime = 300

Set osCurrentTerminal = ThisFrame.SelectedView.control
Set osCurrentScreen = osCurrentTerminal.Screen

Dim myUser As String
myUser = Environ("username")

Dim TicketNumberFile As String

TicketNumberFile = InputBox("Enter the Ticket Number", , , vbCritical)

If TicketNumberFile = vbNullString Then
Exit Sub
End If

Dim fso3
Dim folderTicketFilePath As String

Set fso3 = CreateObject("Scripting.FileSystemObject")
folderTicketFilePath = "S:\Manual_Booking\BOOKING\RA"
fileTicket = (TicketNumberFile)
FullPath = (folderTicketFilePath) & "\" & (fileTicket) & ".csv"

' Reading File from S:\Manual_Booking\BOOKING\RA\(TICKET NUMBER).csv

MyFile = (FullPath)
Open MyFile For Input As #1 ' Open file for input.

'*************************************************************************************************************************************************************
' VARIABLES
'*************************************************************************************************************************************************************
Input #1, Id, CustName, CustAddress1A, CustAddress1B, CustAddress2, CustAddress3 ' Read data into variables.

'Customer Name/Address

osCurrentScreen.SendKeys "1"
Call Wait_50
Call Enter_50
Call osCurrentScreen.SendKeys(CustName) ' 4 CustName
Call Wait_50
Call Enter_50
osCurrentScreen.SendKeys "2"
Call Wait_50
Call Enter_50
Call osCurrentScreen.SendKeys(CustAddress1A) ' 5 CustAddress1A
Call Wait_50
osCurrentScreen.SendKeys " "
Call Wait_50
Call osCurrentScreen.SendKeys(CustAddress1B) ' 6 CustAddress1B
Call Wait_50
Call Enter_50
osCurrentScreen.SendKeys "3"
Call Wait_50
Call Enter_50
Call osCurrentScreen.SendKeys(CustAddress2) ' 7 CustAddress2
Call Wait_50
Call Enter_50
osCurrentScreen.SendKeys "4"
Call Wait_50
Call Enter_50
Call osCurrentScreen.SendKeys(CustAddress3) ' 8 CustAddress3
Call Wait_50
Call Enter_50

End Sub

RE: csv file breaking after numeric characters and special characters

(OP)
I have no idea why is breaking up the data on the numeric and special characters. May be the way I am opening the file??? but I am not sure. Thanks for the help.

RE: csv file breaking after numeric characters and special characters

Please post a typical record, all 6 values EXACTLY AS THEY APPEAR IN THE TEXT FILE.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: csv file breaking after numeric characters and special characters

(OP)
1 Joe Doe 1 Main St Downtown Building 2nd Floor Room 13
2 Bruce Wayne 9 Batcave Rd Bat Cave Building 1st Floor Room 1
3 Bruce Lee 1 Karate Way Chinatown Building 3rd Floor Room 5
4 Jet Li 26_Karate_Way Chinatown_Building 4th Floor Room 6

The results would be

1 Joe Doe 1 Downtown Building 2 Room 13
2 Bruce Wayne 9 Bat Cave Building 1 Room 1
3 Bruce Lee 1 Chinatown Building 3 Room 5
4 Jet Li 26 Chinatown 4 Room 6

I lost data after Numeric Characters and Special Characters.

RE: csv file breaking after numeric characters and special characters


Declare your input variables explicitly as String.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: csv file breaking after numeric characters and special characters

(OP)
Thank You. I didn't even realized the variables were not declared. I was scratching my head and it was a simple fix.
Have a great day!!!

RE: csv file breaking after numeric characters and special characters

It is a best and accepted practice to explicitly declare all variables appropriately for type and scope.

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close