I got about 300 (.txt) files in a folder with "normal text" formatted with /n's. I want all text in these files, to be in the first line, because a program in my pipeline requires that.
Exampel:
(IS:)
GTCGCAGCCG
TCGGCTCGGA
TCTCGGCCTC
(SHOULD BE:)
GTCGCAGCCGTCGGCTCGGATCTCGGCCTC
If I could overwrite them all, with file names staying the same, that would be convenient. I don't want to crack out python yet, is there an easy UNIX tool / command line approach?
I was here before: How do I remove newlines from a text file?
But how to do that for all 300 files in my folder? If i use tr -d '\n' < *.txt
it tells me: "bash: *.txt: ambiguous redirect"