Thanks for your time. I tried to follow your code but I am not getting the same result as you got!
As my file is in .dat format, so I used,
dat <- fread("AE33_AE33-S09-01153_20230101.dat")
for that, I am facing some warnings as:
Warning messages:
1: In fread("AE33_AE33-S09-01153_20230101.dat") :
Detected 1 column names but the data has 4 columns (i.e. invalid file). Added 3 extra default column names at the end.
2: In fread("AE33_AE33-S09-01153_20230101.dat") :
Stopped early on line 4. Expected 4 fields but found 5. Consider fill=TRUE and comment.char=. First discarded non-empty line: <<Number of channels = 7>>
then, I used
dat <- read.delim("AE33_AE33-S09-01153_20230101.dat")
not getting a warning this time, so further I used
colnames(dat) <- c("Date",
"Time",
"Timebase",
"RefCh1",
"Sen1Ch1",
"Sen2Ch1",
"RefCh2",
"Sen1Ch2",
"Sen2Ch2",
"RefCh3",
"Sen1Ch3",
"Sen2Ch3",
"RefCh4",
"Sen1Ch4",
"Sen2Ch4",
"RefCh5",
"Sen1Ch5",
"Sen2Ch5",
"RefCh6",
"Sen1Ch6",
"Sen2Ch6",
"RefCh7",
"Sen1Ch7",
"Sen2Ch7",
"Flow1",
"Flow2",
"FlowC",
"Pressure_PA",
"Temperature_C",
"BB_pct",
"ContTemp",
"SupplyTemp",
"Status",
"ContStatus",
"DetectStatus",
"LedStatus",
"ValveStatus",
"LedTemp",
"BC11",
"BC12",
"BC1",
"BC21",
"BC22",
"BC2",
"BC31",
"BC32",
"BC3",
"BC41",
"BC42",
"BC4",
"BC51",
"BC52",
"BC5",
"BC61",
"BC62",
"BC6",
"BC71",
"BC72",
"BC7",
"K1",
"K2",
"K3",
"K4",
"K5",
"K6",
"K7",
"TapeAdvCount",
"blank1",
"blank2",
"blank3")
But again got the error as
Error in names(x) <- value :
'names' attribute [70] must be the same length as the vector [1]