×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

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.

Students Click Here

delimited file, starting at position...

delimited file, starting at position...

delimited file, starting at position...

(OP)
i have a file that i want to link.  every field after position 1082 is separated by a ;.  The first part of the file, however is not.  I'd like to separated the fields like this:
Field 1 = everything before 1082.
Field 2 = everything from 1082 to first ;.
Field 3 = from first ; to second ;.
Field 4 = from second ; to third ;.
and so on...

But when you choose to link by delimited fields, it won't allow you to create other fields separaters.

any suggestions?
kerri

RE: delimited file, starting at position...


You could link the file twice with two different names.

First link would skip every field after column 1081. You could specify the delimiter for this link or link as fixed width.

The second link would skip all fields up to 1081 and specify the ";" delimiter.

You would need to be careful about properly handling rows from each table that belong together.

Terry
http://members.home.net/tlbroadbent/prog.htm
------------------------------------
Experience is the hardest kind of teacher. It gives you the test first, and the lesson afterward.

RE: delimited file, starting at position...

(OP)
there's nothing separating the first part of the file from the 1082.  it won't let me set a field separater there when i link it with delimited fields.  it kinda looks like this:

aolkj   akdfu  jaf45621 jalkjlkajsd kja dkaljf 5646 216543 154;62135432;46543210;5641

where 6 or 7 or sometimes 10 positions before the first ;, is position 1082.

does that make sense?

RE: delimited file, starting at position...


It makes sense and you can still do as I recommended. Let me explain.
  1. Start the Link Text Wizard and choose the file.
  2. Select Fixed Width
  3. On the next screen, mark the field breaks including column 1082. Remove all field breaks after column 1082.
  4. On the next screen set up the first 1082 characters for import. Mark the field after 1082 as Do not import (Skip
  5. Click Next and on the next screen type a table name.
  6. Click finish.
Now we will link the table again.
  1. Start the Link Text Wizard and choose the file.
  2. Select Delimited
  3. Choose the delimiter ";"
  4. On the next screen set up the characters after 1081 for import. Mark the field before 1082 as Do not import (Skip
  5. Click Next and on the next screen type a table name.
  6. Click finish.
You now have two tables, one displaying the data upto 1082 and the other displaying the data after.

I've just tested this technique and found that if I open both tables at the same time, I get the layout of whichever was opened first. So this technique is limited in that yo can't open both links to one table at the same time. You can work around that limitation by copying the file and linking one file as fixed width and the other as delimited.

I hope this helps. It's only one suggestion. You could also import the file to a table and parse it with queries or code. You could read each line of the table in a module, parse the line and insert into a table. There are numerous possibilities.

Terry
http://members.home.net/tlbroadbent/prog.htm
------------------------------------
Experience is the hardest kind of teacher. It gives you the test first, and the lesson afterward.

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