|
Answer» Hi there,
I have no idea how to resolve my problem. I guess a dos batch file can help me, but I've got no idea how to start.
I've got two files, with similar contents. Both files are csv- files (comma separated value) which can be read by excel, but also with notepad (as txt-files) The headers in both files are the same. Now I want to JOIN the contents of one file, into the other file (or create one master-file of the two files).
Does anyone have an idea how i can do this (or is this even possible)?
Greetings
Shape
Did you want to keep the header of one of them and DISCARD it from the other? Let's suppose that both files are valid spreadsheet files. If so, there will be mathematical expressions that may have absolute reference to cells inside the spreadsheet. But once the two files are combined as a simple text file., the REFERENCES will not be correct. Does that MAKE sense to you? If your intent is to just combine the two files together for the purpose of documentation that would be an acceptable thing. Otherwise, if you really want that to spreadsheets to work together as one, you would have to use the features inside of XL two combined to spreadsheets together. Possibly, you would have to create a book inside of XL and each spreadsheet would be a separate page inside of one book. Then you would have to do some additional work so that the output of one page could be referenced on the second page and perhaps a sum total of the entire project could be given on the third page. Or something like that. By the way, is this some type of homework assignment? What you need to know is that the operating system itself is rather ignorant of the needs of application programs, at least at the file level. Relationships between application programs are controlled by a higher order of structure that is outside the domain of batch files. Was this of any help? Or did I just make things worse?@Salmon If possible, with out the header...
Searching this forum, It seems that part of the problem has been resolved in another topic.
@echo off echo. > G:\dos\master\master.csv cd G:\dos for /f %%a in ('dir /b *.txt') do type %%a >> G:\dos\master\Master.csv pause
This works just fine (for which my thanks, it saves me a lot of work!)
Quote from: Geek-9pm on December 22, 2009, 12:10:07 PM Let's suppose that both files are valid spreadsheet files.
The files are not valid spreadsheet files. A csv-file is a text file that excel can read by conversing a dot comma as the END (or start) of a new column in excel (B-column)
Quote from: Geek-9pm on December 22, 2009, 12:10:07 PMDoes that make sense to you?
The dos commands as shown above, already works.
Quote from: Geek-9pm on December 22, 2009, 12:10:07 PMIf your intent is to just combine the two files together for the purpose of documentation that would be an acceptable thing. Otherwise, if you really want that to spreadsheets to work together as one, you would have to use the features inside of XL two combined to spreadsheets together.
It makes a csv files, which excel can convert. the Master.csv works well in excel
Quote from: Geek-9pm on December 22, 2009, 12:10:07 PMPossibly, you would have to create a book inside of XL and each spreadsheet would be a separate page inside of one book. Then you would have to do some additional work so that the output of one page could be referenced on the second page and perhaps a sum total of the entire project could be given on the third page.
The data is shown in one page, inside the file
Quote from: Geek-9pm on December 22, 2009, 12:10:07 PMBy the way, is this some type of homework assignment?
A serious work related problem, which needs a quick fix!
Quote from: Geek-9pm on December 22, 2009, 12:10:07 PMWas this of any help? Or did I just make things worse?
You decide
|