How to convert these IDs with slash (/) sign to a list?
1
0
Entering edit mode
4.5 years ago
tpm ▴ 30

For example, converting this:

948369/947077/945082/948443/947139/944753/944750/946344/948378/944902/948665/948655/947097/948697/945693/948698/948688/944885/946525/947178/947912/948430/948429/945099/948200/948192/946315/945173/945085/948690/945371/945392/947519/945830/947056/948233/946648/947672/945887/946179/945425/947567/947970/947859/948403/945081/945066/946430/945304/947398/947666

To this kind of format:

948369
947077
945082
948443
947139
944753
944750
946344
948378
944902
948665

It is cumbersome to remove the backward slash sign individually, when I have 500 of them for instance, and so I would like to do it simultaneously.

Thanks in advance :)

gene • 639 views
ADD COMMENT
2
Entering edit mode
4.5 years ago
GenoMax 147k

Try

$ echo "948369/947077/945082/948443/947139/944753/944750/946344/948378/944902/9" | tr "/" "\n"
948369
947077
945082
948443
947139
944753
944750
946344

cat if_in_a_file and then redirect to a new file if you want to save.

ADD COMMENT
0
Entering edit mode

Thank you a million! Quick question, is it possible to do this execution on R as well?

ADD REPLY

Login before adding your answer.

Traffic: 2697 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6