Hi,
I have hundreds of instrument-generated csv files,
each file containing two columns of numbers (representing X and Y values of a spectrum) with no headers.
how to import the csv files into the dataframe so,
that for each imported file there are two NEW columns added with filenames in the column header.
(the number of columns is equal to the number of files*2 with the file names in the first row of the columns)
The final data frame / csv file should look like this:
05AC001.csv; 05AC001.csv; 05AC002.csv; 05AC002.csv
0.0001; 46823.112; 0.0001; 65944.23
0.0002; 45682.215; 0.0002; 65973.24
0.0003; 68231.212; 0.0003; 39751.11
; is used here as a column separator
I tried to google questions like: "how to append/merge/add/concatenate multiple csv files as a columns in R"
and found, that:
- almost all examples are appending the csv files to make one file with two long columns
(It can be done with simple command even in the windows) - stackoverflow.com is completely useless, people just reposting fragments of code that are not working at all or are missing something substantial for functioning.
I have some basic knowledge of R(ggplot2) and have all different packages/libraries installed (dplyr, tidyverse, ... etc) R 4.0.4 and the latest RStudio installed win10.
It should be elementary, and I have the feeling that I am not asking the correct keywords/phrases?