Results 1 to 3 of 3

Thread: Stripping lines of info from a text file

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    North east UK
    Posts
    129

    Stripping lines of info from a text file

    Hi All,

    can anyone tell me how i could strip lines of code from a text file. The file is something like

    ABC|123|FGH|THG
    DEF|XVZ|123|999|

    All lines to not have unique field locations so i cannot do a straight forward import. I need to get each line that starts with let's say "ABC" and drop those into a table.

    Thanks in advance.

  2. #2
    Junior Member
    Join Date
    Mar 2003
    Location
    Mt. Holly, NJ
    Posts
    31
    If your text really has "|" between the sections of code,why not just open the text file in Excel and use the "|" character as a delimiting signifier? That way you'll get something like:

    A B C D
    1 ABC 123 FHG THG
    2 DEF XVZ 123 999

  3. #3

    Thread Starter
    Addicted Member
    Join Date
    Jan 2004
    Location
    North east UK
    Posts
    129
    I can do that but there are varying feild lengths within the text file, for example the ABC row may have 6 feilds and the DEF row may have 16 fields.

    I am wanting to go through the text file line by line and then filter out the ABC's and then validate each line to ensure the data is accurate.

    Importing into Excel or Access means that I have to run an additional query against the Information to filter out the appropriate rows and I am trying to do it in 1 step with as little intervention as possible from the user.

    thanks for your reply.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width