本文介绍了如何获取while循环来识别提取的数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个相当简单的脚本,它应该打印出来自txt文件的行,并根据我想要的位置对它们进行分组。我使用脚本的文件的一般格式如下:


662376 [S] | GCGG | | |

662375 [S] | CGCC | | |

662374 [S] | GCGG | | |

662373 [H] | CATC | | |

662371 [Y] | TCCC | | |

662369 [M] | CACCC | | |

662367 [Y] | TCTTT | | |

662365 [S] | GCGGG | | |

662364 [R] | AGAAA | | |

662360 [M] | CACCC | | |

662359 [W] | ATAAA | | |

662358 [S] | CGCCC | | |

662357 [M] | ACAAA | | |

662356 [R] | GAAAG | | |

662354 [S] | GCGGG | | |

662353 [R] | AGAAA | | |

662352 [R] | GAGGG | | |

662350 [K] | TGTTT | | |

662349 [Y] | CTCCC | | |

662348 [M] | ACAAA | | |

662347 [R] | GAGGG | | |

662376 [S] | GCGG | | |

662375 [S] | CGCC | | |

662374 [S] | GCGG | | |

662373 [H] | CATC | | |

662371 [Y] | TCCC | | |

662369 [M] | CACCC | | |

662367 [Y] | TCTTT | | |

662365 [S] | GCGGG | | |

662364 [R] | AGAAA | | |

662360 [M] | CACCC | | |

662359 [W] | ATAAA | | |

662358 [S] | CGCCC | | |

662357 [M] | ACAAA | | |

662356 [R] | GAAAG | | |

662354 [S] | GCGGG | | |

662353 [R] | AGAAA | | |

662352 [R] | GAGGG | | |

662350 [K] | TGTTT | | |

662349 [Y] | CTCCC | | |

662348 [M] | ACAAA | | |

662347 [R] | GAGGG | |这是代码:

I am writing a fairly simple script that is supposed to print out lines from a txt file and group them based on where I want them. The general format of the files I am using the script on is as follows:

662376 [S] |GCGG | | |
662375 [S] |CGCC | | |
662374 [S] |GCGG | | |
662373 [H] |CATC | | |
662371 [Y] |TCCC | | |
662369 [M] |CACCC| | |
662367 [Y] |TCTTT| | |
662365 [S] |GCGGG| | |
662364 [R] |AGAAA| | |
662360 [M] |CACCC| | |
662359 [W] |ATAAA| | |
662358 [S] |CGCCC| | |
662357 [M] |ACAAA| | |
662356 [R] |GAAAG| | |
662354 [S] |GCGGG| | |
662353 [R] |AGAAA| | |
662352 [R] |GAGGG| | |
662350 [K] |TGTTT| | |
662349 [Y] |CTCCC| | |
662348 [M] |ACAAA| | |
662347 [R] |GAGGG| | |
662376 [S] |GCGG | | |
662375 [S] |CGCC | | |
662374 [S] |GCGG | | |
662373 [H] |CATC | | |
662371 [Y] |TCCC | | |
662369 [M] |CACCC| | |
662367 [Y] |TCTTT| | |
662365 [S] |GCGGG| | |
662364 [R] |AGAAA| | |
662360 [M] |CACCC| | |
662359 [W] |ATAAA| | |
662358 [S] |CGCCC| | |
662357 [M] |ACAAA| | |
662356 [R] |GAAAG| | |
662354 [S] |GCGGG| | |
662353 [R] |AGAAA| | |
662352 [R] |GAGGG| | |
662350 [K] |TGTTT| | |
662349 [Y] |CTCCC| | |
662348 [M] |ACAAA| | |
662347 [R] |GAGGG| | |


and here is the code:

展开 | 选择 | 换行 | 行号

推荐答案

展开 | 选择 | Wrap | 行号




这篇关于如何获取while循环来识别提取的数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 10:21