Hello,
I'm new on this forum and I need a macro to help me to copy the values from multiple "txt" files into a single Excel file.
The details are:
- I have many "txt" files (could be hundreds or thousands)
- the files names are similar to: 1715900115406111-30062017111747.10007-tor (it's a txt file, despite the strange extension!)
- each txt file can have thousands of rows; number of rows can be different from file to file
- each row has 2 groups of values delimited by semicolon; an example: 0.010;0.885
- interested data are in the 2nd group
- all files are in the same folder
What I need:
- make/open a Master file (Excel)
- Master file can be in the same folder with txt files or not
- open first txt file
- convert txt -> columns
- copy txt file name to 1st row in Master; for example: A1 = 1715900115406111
- copy txt file date to 2nd row in Master; for example: A2 = 30.06.2017
- copy txt file hour to 3rd row in Master; for example: A3 = 11:17:47
- copy txt file station number to 4th row in Master; for example: A4 = 10007
- copy all data from txt file column "B" starting with row 5, below the station number; for example: A5:A14560
- do the same thing for all files in the next columns...
I have almost no knowledge about VB so in need a little help on this . I make same small macros, but nothing like this.
If I have 5-10 txt files I can do it manually, but for hundreds of files is not possible.
Please help me with a macro.
Thanks a lot.
I'm new on this forum and I need a macro to help me to copy the values from multiple "txt" files into a single Excel file.
The details are:
- I have many "txt" files (could be hundreds or thousands)
- the files names are similar to: 1715900115406111-30062017111747.10007-tor (it's a txt file, despite the strange extension!)
- each txt file can have thousands of rows; number of rows can be different from file to file
- each row has 2 groups of values delimited by semicolon; an example: 0.010;0.885
- interested data are in the 2nd group
- all files are in the same folder
What I need:
- make/open a Master file (Excel)
- Master file can be in the same folder with txt files or not
- open first txt file
- convert txt -> columns
- copy txt file name to 1st row in Master; for example: A1 = 1715900115406111
- copy txt file date to 2nd row in Master; for example: A2 = 30.06.2017
- copy txt file hour to 3rd row in Master; for example: A3 = 11:17:47
- copy txt file station number to 4th row in Master; for example: A4 = 10007
- copy all data from txt file column "B" starting with row 5, below the station number; for example: A5:A14560
- do the same thing for all files in the next columns...
I have almost no knowledge about VB so in need a little help on this . I make same small macros, but nothing like this.
If I have 5-10 txt files I can do it manually, but for hundreds of files is not possible.
Please help me with a macro.
Thanks a lot.