如果单元格中有以下数据,我想提取一些文本:
salutation login ID email password first_name middle_name last_name gender date_of_birth account_status user_address1 user_address2 city postal_code country telephone id_card_number role
Mr. bawan 1 bawan@gmail.com bbbbbb Bashir Awan male 18-07-1988 active 55-B Faisal Town Lahore 54000 Pakistan 0423-5599229 34220-0353392-1 admin
Mr. njawad 2 nasir@hotmail.com nnnnnn Nasir Jawad male 21-03-1979 active 193 SherShah Colony Gujranwala 54000 Pakistan 0319-2292299 35210-3523327-2 supervisor
Dr. hakhan 3 faisal_khan@yahoo.com hhhhhh faisal Aslam Khan male 12-05-1973 active House# 77 Mumtaz Street, Sham Nagar Gujrat 54000 Pakistan 0349-8280022 34220-0353392-1 admin
Ms. tnoor 4 tayyaba.noor@live.com tttttt Tayyaba Noor female 15-01-1980 active 483 Ghazanvi Road Faisalabad 54000 Pakistan 0381-5589333 34220-0353392-1 marketing executive
上面显示的数据在 excel 中正确格式化,显示有点整洁。
这就是我正在做的事情:
=CONCATENATE("{:salutation=>", A2 , ", :login =>",B2," , :ID=>", C2,", :email =>",D2,", :password=>",E2,", :first_name=>",F2,", :middle_name=>",G2,", :last_name=>",H2,", :gender =>",I2," , data_of_birth=>",J2,", :account_status=>",K2,", :user_address1=>",L2,", :user_address2=>",M2,", :city=>",N2,", :postal_code=>",O2,", :country=>",P2,", :telephone=>",Q2,", :id_card_number=>",R2,", :role=>",S2,"},")
我得到了这个结果:
{:salutation=>Mr., :login =>bawan , :ID=>1, :email =>bawan@gmail.com, :password=>bawan1, :first_name=>Bashir, :middle_name=> , :last_name=>Awan, :gender =>male , data_of_birth=>18-07-1988, :account_status=>active, :user_address1=>55-B, :user_address2=>Faisal Town, :city=>Lahore, :postal_code=>54000, :country=>Pakistan, :telephone=>0423-5599229, :id_card_number=>34220-0353392-1, :role=>admin},
但我希望生成这个:
{:salutation=>"Mr.", :login =>"bawan" , :ID=>"1", :email =>"bawan@gmail.com", :password=>"bawan1", :first_name=>"Bashir", :middle_name=>"" , :last_name=>"Awan", :gender =>"male" , data_of_birth=>"18-07-1988", :account_status=>"active", :user_address1=>"55-B", :user_address2=>"Faisal Town", :city=>"Lahore", :postal_code=>"54000", :country=>"Pakistan", :telephone=>"0423-5599229", :id_card_number=>"34220-0353392-1", :role=>"admin"},
那么我要改变什么
=CONCATENATE(code)
生成上面的!