Field delimiter formatting
Hi Roman,
Import into Excel as it is, all in one column.
Then DataText to columns, with # as the delimiter. Now your comment is safe.
Then insert enough blank columns and do another DataText to columns, check all possible delimiters and check "Treat consecutive
delimiters as one"
--
Kind regards,
Niek Otten
Microsoft MVP - Excel
"RomanR" wrote in message ups.com...
| Hey all,
|
| I need to format a text file that has about 2500 entries, set up in 3
| fields like this:
|
| 111.22.33.44 machinename # a coment goes here
|
| This file has gotten updated over the years, but the field delimiters
| havent been kept constant: some are single tabs (good), others are
| several spaces/tabs (bad). If I could format the file in such a way
| that the 3 fields are separated by a single tab, that would make
| importing the file into Excel far cleaner.
|
| I've thought about adding a method to my macro that goes through the
| text file and replaces all spaces with a single tab, but unfortunately
| this would also be done to the comments, which I can't have happen. All
| spaces, and multiple tabs separating the 3 fields need to be replaced
| with a single tab, and anything after the '#' sign needs to be left as
| is.
|
| Is there a way that this delimiter formatting can happen after
| importing into excel, or is it something that needs to be done into a
| temp file before importing? Any and all help is appreciated.
|
| Thanks in advance,
|
| Roman
|
|