This site uses different types of cookies, including analytics and functional cookies (its own and from other sites). To change your cookie settings or find out more, click here. If you continue browsing our website, you accept these cookies.
I have a list of csv files with different schemas. From these files I only want to import the common headers listed below. The file names also keep changing. The only common word in the filenames are "decom". Is there a macro I can use to import the required fields from these files?
@racoon in terms of bringing multiple csv files, you can use the Input Data tool (under the In/Out tools category), point to one of the files that you want to bring in, then use the * wildcard to replace the variable portion of the file name and keep the common portion. For example, this could look like this: *dcom*.csv
Once you bring in the .csv files, you can use the Select tool (under the Preparation tools category) to keep only the 14 columns that you want to bring in.
I hope this helps. Please let me know how it goes.
I'm not aware of a tool that will read in only specific headers of files with different schemas, but you could probably read all the files in then use Dynamic Select to drop all that aren't in that list.
@CameronS has written a macro that will allow you to read in a number of files with different schemas, and you may be able to adapt it to your purposes. You can find his explanation here: