Wednesday 17 October 2018

microsoft excel - Import set of text files to a set of columns

I have a set of text files named outfile00.txt until outfile297.txt. Each file has a number (decimal or otherwise) on every line except the first one (which is like a header).


I need to import the contents of each file to a column starting from column A (which will correspond to outfile00.txt) until all text files have been imported.


Here is a sample of the beginning of outfile00.txt:


KP=0.50 ,Ki=0.10 ,Kd=0.05
0.00
0.00
0.00
0.00

The actual file has about 1500 lines. I've tried manually importing the text file using the Data tab; Excel has no issues and the text is imported.


How can I import all the text files as a batch?


EDIT


I believe I had not defined my problem clearly, so here are some extra details.


With regards to cybernard's method,


If I create a tab-separated values file (the tab character is between the letter and number on each line) as follows,


a   1
b 2
c 3
e 4
f 5
g 6

I can import the text file directly and get the following,


Imported Tab-separated values file


I was hoping to create a file similar to the aforementioned TSV file. An example would be as follows,


KP=0.50 ,Ki=0.10 ,Kd=0.05   KP=0.50 ,Ki=0.10 ,Kd=0.10   KP=0.50 ,Ki=0.10 ,Kd=0.15
0.00 117.00 123.00
0.00 118.00 124.00
0.00 119.00 125.00
0.00 120.00 126.00

which produces the following import results,


Imported results from generated TSV file


I need to know how I can generate such a TSV file from my source files.

No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...