+ 1
How would I use re expressions to retrieve multiple number off of a column and line of a CSV file?
I have managed to open up the CSV file and get to a specific column and line. An example, my number could look like CCC123/637 or d123. I'm thinking I want to find all the sets of numbers in a line and stick them in an array so on the example above line[0] =[123,657] line[1]=[123]
4 ответов
+ 3
One way could be this: split input at newline character, then split each substring at non-numeric characters
+ 3
Charlie Crease-huggett
Based on what Lisa rightly proposed, I would go about it like this:
Edit: if you need it in int form, you can of course use map() on the fly when appending
https://code.sololearn.com/cqbTEoclpbuL/?ref=app
+ 1
That's exactly what I need perfect thank you 😁
+ 1
I updated the code for if you needed int, instead of str being appended