Hi Friends i have a .csv file in which there are some unwanted text which i want to remove for extracting the files name only. If anybody is having any idea to solve this please help.
>(Get-Content "D:\Convert\txtdoc\rtbTextBox.csv") | >Foreach-object {$_ -replace ".*>" -replace "<\.*"} | >Set-Content "D:\Convert\txtdoc\rtbTextBox.csv" File is having Text as below: TEST-2014-08026 30-05-2014 Developer svn://10.285.120.144/devmd/Trunk load\hcl\safetoload\doc_typ\TEST-2014-08026_doc_typ.csv hcl\safetoload\doc_typ\doc_typ.ctl load\hcl\safetoload\doc_typ_arg\TEST-2014-08026_doc_typ_arg.csv hcl\safetoload\doc_typ_arg\doc_typ_arg.ctl load\hcl\safetoload\doc_lblfmt\TEST-2014-08026_doc_lblfmt.csv hcl\safetoload\doc_lblfmt\doc_lblfmt.ctl load\hcl\safetoload\dscmst\TEST-2014-08026_dscmst.csv hcl\safetoload\dscmst\dscmst.ctl load\hcl\safetoload\lblfmt\TEST-2014-08026_lblfmt.csv hcl\safetoload\lblfmt\lblfmt.ctl labels LABEL\1662_ceva_carlbl.POF LABEL\1662_ceva_carlbl.lbl 1662_ceva_carlbl.msql I want to save result as For EX :** TEST-2014-08026_doc_typ.csv
doc_typ.ctl
TEST-2014-08026_doc_typ_arg.csv
doc_typ_arg.ctl
TEST-2014-08026_doc_lblfmt.csv
VulpesRank #55 · 29.2K reputationPosted Jul 30, 2014, 7:26 AM EDT
The output is:
I'm not clear from your post whether you just want to extract these details or to save the 'cleaned' data back to the file?
Naveen Singh10 reputationPosted Jul 30, 2014, 7:48 AM EDT
VulpesRank #55 · 29.2K reputationPosted Jul 30, 2014, 7:57 AM EDT
Naveen Singh10 reputationPosted Jul 30, 2014, 8:15 AM EDT
VulpesRank #55 · 29.2K reputationPosted Jul 30, 2014, 8:32 AM EDT
Naveen Singh10 reputationPosted Jul 30, 2014, 9:14 AM EDT
VulpesRank #55 · 29.2K reputationPosted Jul 30, 2014, 9:41 AM EDT
The csv file now looks like this:
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts