Python Forum
I need to get only string datatype and report in excel file.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I need to get only string datatype and report in excel file.
#1
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
Reply
#2
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?
Reply
#3
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
Reply
#4
I need to fetch only those data starting from
<S t='s'
which is basically a string data type
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Python openyxl not updating Excel file MrBean12 1 249 Mar-03-2024, 12:16 AM
Last Post: MrBean12
  Unable to download TLS Report attachment blason16 6 455 Feb-26-2024, 07:36 AM
Last Post: Pedroski55
  Copy Paste excel files based on the first letters of the file name Viento 2 346 Feb-07-2024, 12:24 PM
Last Post: Viento
  Search Excel File with a list of values huzzug 4 1,147 Nov-03-2023, 05:35 PM
Last Post: huzzug
  Updating sharepoint excel file odd results cubangt 1 752 Nov-03-2023, 05:13 PM
Last Post: noisefloor
  trouble reading string/module from excel as a list popular_dog 0 384 Oct-04-2023, 01:07 PM
Last Post: popular_dog
  Need to replace a string with a file (HTML file) tester_V 1 698 Aug-30-2023, 03:42 AM
Last Post: Larz60+
  Reading data from excel file –> process it >>then write to another excel output file Jennifer_Jone 0 1,046 Mar-14-2023, 07:59 PM
Last Post: Jennifer_Jone
  Save and Close Excel File avd88 0 2,839 Feb-20-2023, 07:19 PM
Last Post: avd88
  Trying to access excel file on our sharepoint server but getting errors cubangt 0 769 Feb-16-2023, 08:11 PM
Last Post: cubangt

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020