1

I try to realize a tiny function that is to read users name from **fastalist ** file and to parallely create name.txt. But the spliced filenames confused me.

As shown in the below, the first one name is '1pazA' but the output is '.txtA'. It is likely the first 3 letters are replaced. However, for the second out is right.

# cmd
cat BuildFeatures/example/fastalist | parallel -j 5 echo {}.txt
# out
.txtA
T0968s1.txt

# fastalist file content
1pazA
T0968s1

I expect to get the right spliced string.

WuGuo
  • 11
  • 2
  • 1
    Looks to me like an encoding issue. I can reproduce it when `fastalist` is saved as a csv file from an excel spreadsheet. One solution is to use [dos2unix](https://linux.die.net/man/1/dos2unix) to remove [BOM](https://en.wikipedia.org/wiki/Byte_order_mark) and change line endings from CRLF to LF. You can also use sed (e.g. https://stackoverflow.com/questions/45240387/how-can-i-remove-the-bom-from-a-utf-8-file), or many other methods to 'reformat' the file – jared_mamrot Feb 17 '23 at 10:48
  • @jared_mamrot Wow, that is well spotted. If the input lines end in \r\n that explains the results perfectly. – Ole Tange Feb 17 '23 at 23:28

0 Answers0