If you imported data from Python to split, but each file has a slightly different location...

Asked 1 weeks ago, Updated 1 weeks ago, 1 views

Hello, everyone I loaded the 44th data with split, but each file has a different value. I only need WZM values, is there a way to get only WZM values?

    for i in data:
        if 'example' in i:
            test1 = i.split(',')[44]
            print(test1)

When executing with the above code, file A is expressed as WZM = 8.2214~~, but file B is populated with different values in the same sentence...

I'd appreciate it if you could answer.

python

2022-09-20 10:28

1 Answers

If you look at the code, it looks like a Python library, but it would be good to extract and use the desired string using several regular expression libraries.

Alternatively, it can be used as a method of separating by split(';') and then adding a routine to check if the value of the separated content is WZM.


2022-09-20 10:28

If you have any answers or tips


© 2022 pinfo. All rights reserved.