Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Upload some sample data and expected results.
Hi,
You can use subfield function
SubField(vehicle_Name,'-',2)
Left(SubField(vehicle_Name,'-',2),index(SubField(vehicle_Name,'-',2),' ',3)) as Vehicle_no,
Hi,
Try:
Data1:
LOAD
DATA,
Left(SubField(DATA, 'Lafarge - ', 2), 😎 as Vehicle_NO,
Mid(SubField(DATA, 'Lafarge - ', 2), 10) as Driver_Info
INLINE [
DATA
Lafarge - XXX YYYY Driver Name ZZZZZZZZZZZ
];
Saludos
If your data have all the format "Lafarge - ABL etc" then you can use the following statement in your script:
Mid([Vehicle Name],10) as [Vehicle Name]
If the "Lafarge - " text exists omwhere in your field but not always in the start of the field use the following statement in your script:
Trim(Replace([Vehicle Name],'Lafarge - ','')) as [Vehicle Name]
Hi ,
You will achieve like this.
Data:
LOAD *,left(SubField(Field,'Lafarge - ',2),8) as Vehical_Number,
PurgeChar(MID(Field,20,40),'1234567890') as Driver_Name;
LOAD * INLINE [
Field
Lafarge - ABL 1234 Raju 123456789
Lafarge - CVF 2345 David 234567897
Lafarge - ASD 6789 Rama 345679005
Lafarge - BBB 9011 Donald Trump 456790113
Lafarge - TTT 5674 Arjun Rao 567901221
Lafarge - CVF 1234 Henric Consortium 679012329
Lafarge - ASD 7564 Satish 790123437
Lafarge - BBB 6578 sirisha 901234545
Lafarge - TTT 7901 Putin 1012345653
Lafarge - CVF 1801 Kamala 1123456761
];
Thank you arjun.
Hi srikanth99
Happy to help you. Please Mark Correct Answer if you got the answer. Thanks in advance.
Hi arjun,
Please go through this link Need to seperate vehicle no and driver name from field, Lafarge should not come which posted with the excel file.