so according to my sample code the outcome of the new csv file should be:
1. 210269, SC12345678910
2, 210271, 456123
notes:
* the row numbers not constant
* csv file may have more than 2 rows
i managed to get only the "ID" values using "digit" ,
i would like to have a better method and as i requested getting the "CompanyID" values as well.
Code: Select all
FileDelete, c:\csvfile.csv
FileDelete, c:\new_csvfile.csv
; sample of csv file
FileAppend,
(
ID,SN,Type,Model,Model Company,Address,Adress2,Room,Username,IT Name,Phone,Service,Info,CompanyID
210269,111,NNN,MMM,TTT,EEE,YYY1,L001,UUU,VVV,050-1234456,BBB,"AAA,BBB,CCC,DDD",SC12345678910
210271,222,NNN,MMM,TTT,EEE,YYY1,L001,UUU,VVV,050-1234456,BBB,AAAAAAA,456123
), c:\csvfile.csv
Loop, Read, C:\csvfile.csv
{
Column1 := StrSplit(A_LoopReadLine, ",").1
if Column1 =
{
; skip
}
else if Column1 is digit
{
; getting only the "ID" values :(
FileAppend,
(
%Column1%,ComapnyID`n
)
, c:\new_csvfile.csv
}
}