×
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!
  • Students Click Here

*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.

Students Click Here

Jobs

Hello! Looking for a few suggestion

Hello! Looking for a few suggestion

Hello! Looking for a few suggestion

(OP)
Hello! Looking for a few suggestions as I am just dusting off my old COBOL skills.

I'm inputting a file that is created manually from another application and saved as a ".csv" file. The records are variable in length (although I just defined fields as I know the max field length for each field in the record). Since it is a CSV file I was thinking I could just unstring it. However, a few of the fields are just user input text. So a lot of extra spaces, carriage returns, commas, etc. I removed the commas and just replaced with spaces and while that helped some, there still a lot of missing data on the output file.

I'm thinking my approach is flawed. If I read the record in as variable length record would that be a better approach? I'm still not sure I solved the problem of when I view the CSV file in Excel and I'm looking at a certain cell, it is not a continuous record of text. For example, a cell in the CSV file might look something like:

Amy Smith Anytown
OH 55255 This customer did not complete the required fields.

vs a cleaner look:
Amy Smith Anytown OH 55255 This customer did not complete the required fields.

Any suggestions on a different approach of dealing with less than perfect input file formats?

Thanks in advance.

RE: Hello! Looking for a few suggestion

perhaps also some editors can help you to do the job.

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! Already a Member? Login

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