Import lots of txt files into separate rows in one worksheet

MP_7

New Member
Joined
Feb 23, 2020
Messages
18
Office Version
  1. 365
Platform
  1. Windows
Hello,

I'm not good at VBA and neither at power gueries, but I'm trying with the latter, and I'm having some troubles.
What I have is a lot of txt files and the data in those files is just row after row, part of it below
2
3
144
2.50
73
2.50
OR4_GL02_300_3K_2A
etc...

I just need what each row contains into separate columns all in one row

for example:
file 1
A
B
C

file 2
D
E
F

Result:
ABC
DEF

I defined in the query to import only the first 40 rows but after I load it literally imports those 40 values into one row. I don't know how to import the rest of the files?

Thx.
 
Thx a bunch buddy I'll try it soon! Will let you know :)
 
Upvote 0

Excel Facts

Formula for Yesterday
Name Manager, New Name. Yesterday =TODAY()-1. OK. Then, use =YESTERDAY in any cell. Tomorrow could be =TODAY()+1.
Heh sandy I know I'm being a pain in the *** but I'm getting an error

So I paste it into advanced editor, change my source


and then get an error;
Expression.Error: The import Transform File from txt matches no exports. Did you miss a module reference?
Expression.Error: The name 'Sample File' wasn't recognized. Make sure it's spelled correctly.
 
Upvote 0
:ROFLMAO: so do From Folder, Edit, remove all Changed Type, then you should see
steps.png

then do a monkey job with the next steps

btw. Power Query is Case Sensitive so if the name of files are different you'll get error
you've more than 5587 rows so it should be changed (this is hardcoded in the code)
each gear on the right side will show you how this step was done
warning: you will get a problem with Split step
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,099
Messages
6,170,108
Members
452,302
Latest member
TaMere

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top