Python Forum

Full Version: I need to get only string datatype and report in excel file.
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,
I have a python script which uses a source text file as an input.

The text file contains the data of string, numeric, boolean and action data types format.

I need to strip of the numeric, boolean and action data and parse only string data type and log in the csv.

My text file contains the following script:

<S t='a' s='3'/>SetRTEConfig,Done,,<S t='a' s='3'/>LogTestertName,Passed,,<S t='n' c='GT' s='7'/>{PowerUpBed}VerifyBedCurrentDraw,0.271440,Passed,0.080000,,Amps RMS,,<S t='s' c='IgnoreCase' s='5'/>{LogTestertName}LogTesterName,"TS-0418A",Passed,"TS-0418A",,

where t=a is the action data type which i want to strip off and parse only <S t='s' the last one which is string.
and log to csv

How can i do it

Any help is appreciated,

Thank you
So, you want to log the following things to a csv file,
s='3', SetRTEConfig,Done,,,LogTestertName,Passed,,<S t='n' c='GT' s='7',{PowerUpBed}VerifyBedCurrentDraw,Passed,Amps,RMS,,<S t='s' c='IgnoreCase' s='5',{LogTestertName}LogTesterName,"TS-0418A",Passed,"TS-0418A"
Do you need to strip special characters too? How about alpha numeric items?
Hi,

I need to log only
<S t='s' c='IgnoreCase' s='5',{LogTestertName}LogTesterName,"TS-0418A",Passed,"TS-0418A"

and strip off other data. and log in a file

Here are my scripts

https://1drv.ms/u/s!Av5Z02PBCxYcmCVGa7To...h?e=rdPJsZ
I need to fetch only those data starting from
<S t='s'
which is basically a string data type