I have about twenty text files that I want to load into Excel. The suffix is NOT either .txt nor .csv which seems to be the only thing that Excel will accept.
Instead the suffix is .xyz because I work for the xyz insurance company.
What are my options for quickly getting those files into my workbook (each into their own sheet)?
I could possibly xcopy (or something) all of them changing their names to .txt. (The data within is all nicely spaced into columns.)
I’m using office professional 2019, fwiw.
I’ll probably resort to opening each one by one and copy/pasting the data, but, by golly, there ought to be a better way.
I think it’s because they came from an outside consultant that they were so-named.
In the end, they’re just text files. Blech.
You know what, I have a copy-files macro where I could rename them as I copy them. I’m going to use that.
So I have written a VBA macro that would append each of the files in a list (on a sheet in Excel) with a suffix, and combine into a single text file. Then you can import the single file all at once. You would then copy each part to a new sheet.
If the data in the 20 files is clearly defined in a way you can tell which file it belongs to, you can use DOS to combine the files into 1, no need for suffix
Alternatively, you can write a macro that opens each .insco file and does the parsing space delimited on each sheet.
Anyway, like I was sayin’, data is the fruit of the sea. You can barbecue it, boil it, broil it, bake it, saute it. There’s uh, data-kabobs, data creole, data gumbo. Pan fried, deep fried, stir-fried. There’s pineapple data, lemon data, coconut data, pepper data, data soup, data stew, data salad, data and potatoes, data burger, data sandwich. That- that’s about it
I’d create a macro if I were going to do this several times.
One time uploading 20 files? Done in 25 minutes.
And I agree with ND: Space-Delimited is very risky. You might have to check each upload separately for stuff in, say, Column X where there should be no data.
I wrote a generic fixed record flat file to comma delimited prepped for SQL BCP macro in excel. You put the field length and type in a list (you can make multiple import “types”) and list the input and output files (and import type to use for each file). Helps with “one-offs”. You can layer in the BCP call as well.