Link to home
Create AccountLog in
Avatar of Hiro 714
Hiro 714

asked on

Python question

I would like to get Warehouse ID from a string: sample.
Please advise.

sample = '-----\nWarehouse ID: ABC\nVendor ID: CDE\nVendor Name: DED\nMarketplace ID: E'
Expected:
WarehouseID=ABC

Open in new window


Avatar of TunerML
TunerML
Flag of Jamaica image

sample = '-----\nWarehouse ID: ABC\nVendor ID: CDE\nVendor Name: DED\nMarketplace ID: E'
print(sample[:23])

Warehouse ID, would in this case have to be 3 characters max,
ASKER CERTIFIED SOLUTION
Avatar of TunerML
TunerML
Flag of Jamaica image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
SOLUTION
Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.