|
Removing new line characters on every line execpt first line
I have a file of the following form (I've added new line characters to avoid any confusion):
>123456\n
aassfffasfasdfafaadf\n
asdfasdfadsfafda\n
asdfasdfasdfasdfaf\n
asdfsdafadsfasdfadsf\n
etc...
Right I am using the tr command:
tr -d '\n' < filename > newfilename , to get the file but I just realised I don't want the new line character removed from the first line. I'm assuming I'll need to set up some sort of logic with sed, awk, or perl but not sure what to do.
I'm assuming I can just say, if first line, next, else, remove new line character.
|