Results 1 to 7 of 7
  1. #1
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    Darmstadt, Hessen, Germany
    Posts
    128
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Read/Write From ASCII-File (xp-pro - office 2003)

    good morning experts,

    i maintain a large number of technical data in an ascii-file named "parameters.txt" and import them into an excel table for editing...

    now, i like to be able to do some editing, (add - delete - change values), in excel and write the new contents back to the original file...

    the attached file shows the individual record lenghts of the file, that is, a1 to k1 describe the headers followed by their size and the values start at a3 to k3...

    thank you very much...

    best,
    wolfgang

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Read/Write From ASCII-File (xp-pro - office 2003)

    I'm not sure I understand. You can open an ASCII file in Excel, edit it and save it. What exactly is your question?

  3. #3
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    Darmstadt, Hessen, Germany
    Posts
    128
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Re: Read/Write From ASCII-File (xp-pro - office 2003)

    good morning hans...

    thank you very much for your fast reply...

    what i mean is: if my original file holds for example some 20.000 records and i only read 10 records into excel, edit those and write them back to the original file...

    would i not just "overwrite" its contents with just these 10 or less records/lines?!

    i am asking for something like an "append" or similar technique...

    best,
    wolfgang

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Read/Write From ASCII-File (xp-pro - office 2003)

    Do you use VBA to read some lines? The usual method is to write out ALL lines (changed or not) to a new text file, then delete the original and rename the new one.

  5. #5
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    Darmstadt, Hessen, Germany
    Posts
    128
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Re: Read/Write From ASCII-File (xp-pro - office 2003)

    yes, i'm using an import routine that a workmate of mine came up with...

    otherwise i need to import "all" of my data which will make editing really hard...

    i know, for tasks like that, there is access but so far i am quite happy with my mates solution apart from the fact that i can't re-write to the same file...

    best,
    wolfgang

  6. #6
    WS Lounge VIP sdckapr's Avatar
    Join Date
    Jul 2002
    Location
    Pittsburgh, Pennsylvania, USA
    Posts
    11,225
    Thanks
    14
    Thanked 342 Times in 335 Posts

    Re: Read/Write From ASCII-File (xp-pro - office 2003)

    How about import all the records into XL
    Have XL extract the "smaller list"
    Edit as desired from the "small list"
    Add the small list back into the full list in XL
    Save this edited "full list" and overwrite the text file

    Steve

  7. #7
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    Darmstadt, Hessen, Germany
    Posts
    128
    Thanks
    15
    Thanked 2 Times in 2 Posts

    Re: Read/Write From ASCII-File (xp-pro - office 2003)

    hi steve...

    thanks for your advice and by using the autofilter i should be able to do my editing...

    i'll give it a go and see if that approach is feasable...

    best,
    wolfgang

Posting Permissions

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