How to merge two columns in csv file using vbscript?
How i can merge two column in csv file using vbscript or powershell?
1 , 2 , 3 , 4 , 5
1 , 23 , 4 , 5
thanks
Here are two examples
http://msdn.microsoft.com/en-us/library/ms191250.aspx
calulated
http://msdn.microsoft.com/en-us/library/ms191250.aspx
Gary Newman MCSE, MCT, CCNA, MCSD, MCPD, MCDBA, MCAD, MCSA, MCTS Developer and Administrator On SharePoint 2013 SharePoint Practice Manager for AmeriTeach Denver, CO.
Similar Messages
-
How to merge two columns in WAD(column chart)
Dear Experts,
Please provide your valuable suggestion to get a merge two columns in one column WAD column chart.
Example: we are having 3 fields (Budgeted value, Actual budgeted value & non budgeted value).
In the chart to be shown, budgeted value in one column, remaining two to be merged in one column
In below sample image Actual(Volume) column is having twe fields (Budgeted SKU value & Non budgeted SKU),
please provide solution to get same in SAP BI/BW WAD.
Thanks & Regards,
Sudarsan Reddy.Hi..,
With in the internal table structure you can declare one more field like NAME(30).
And concate nate first name and last name into that NAME field of internal table and modify the internal table
Now display this field..
Thanks,
Naveen.I -
How to remove HTML encoding from csv file using powershell
Hi guys i am exporting data from a sharepoint list using powershell which works fine. My problem is that some of the fields contain HTML mark up. Is there a way to remove all of the html mark up from the array before writing it to csv ?
I have tried playing about with System.Web.HttpUtility.HtmlDecode but with no luck the code runs but no html is removed.
Below is a sample of my script.
Set-Variable HOME $env:USERPROFILE -Force
(Get-PSProvider FileSystem).Home = $HOME
if(-not(Get-PSSnapin | where { $_.Name -eq "Microsoft.SharePoint.PowerShell"}))
Add-PSSnapin Microsoft.SharePoint.PowerShell;
# imports assembly needed for url stuff to do
Add-Type -AssemblyName System.Web
$SPWeb = Get-SPWeb "http://site url"
$SPList = $SPWeb.Lists["List Name"]
$exportlist = @()
$SPList.Items | foreach {
$obj = New-Object PSObject -Property @{
"Employee full name" = $_["EMPLOYEEFNAME"]
"Employee login name" = $_["EMPLOYEENAME"]
"Department Name" = $_["DEPARTMENT"]
System.Web.HttpUtility.HtmlDecode("OBJECTIVESTOBEACHIEVED_0") = $_["F1_S4a_OBJECTIVESTOBEACHIEVED_0"]
"OBJECTIVESTOBEACHIEVED_1" = $_["F1_S4a_OBJECTIVESTOBEACHIEVED_1"]
"OBJECTIVESTOBEACHIEVED_2" = $_["F1_S4a_OBJECTIVESTOBEACHIEVED_2"]
"OBJECTIVESTOBEACHIEVED_3" = $_["F1_S4a_OBJECTIVESTOBEACHIEVED_3"]
"OBJECTIVESTOBEACHIEVED_4" = $_["F1_S4a_OBJECTIVESTOBEACHIEVED_4"]
"OBJECTIVESTOBEACHIEVED_5" = $_["F1_S4a_OBJECTIVESTOBEACHIEVED_5"]
"OBJECTIVESTOBEACHIEVED_6" = $_["F1_S4a_OBJECTIVESTOBEACHIEVED_6"]
"OBJECTIVESTOBEACHIEVED_7" = $_["F1_S4a_OBJECTIVESTOBEACHIEVED_7"]
$exportlist += $obj
$exportlist | select "Employee full name", "Employee login name", "Department Name", "OBJECTIVESTOBEACHIEVED_0", "OBJECTIVESTOBEACHIEVED_1", "OBJECTIVESTOBEACHIEVED_2", "OBJECTIVESTOBEACHIEVED_3", "OBJECTIVESTOBEACHIEVED_4", "OBJECTIVESTOBEACHIEVED_5", "OBJECTIVESTOBEACHIEVED_6", "OBJECTIVESTOBEACHIEVED_7" | Export-Csv ~/Export.csv -noType
$SPWeb.Dispose()
any help would be much appreciated.Should have googled before posting !
"OBJECTIVESTOBEACHIEVED_0" = [Microsoft.SharePoint.Utilities.SPHttpUtility]::ConvertSimpleHtmlToText($_["F1_S4a_OBJECTIVESTOBEACHIEVED_0"],-1) -replace '\s+', ' '
Clears all the additional white space. As always jrv you
have saved the day, many thanks for all the help.
Mal -
How to export data to an excel file using VBScript
I'm trying to create a VBScript in DIAdem (V9.1) which automatically saves all the current channels in the data portal to an excel file. I've tried using 'Call ExcelExport' and specify a full file path but the file is never created. What am I doing wrong?
Thanks,
SteveHi Steve,
There are a couple of other things you can try. If you don't like Ingo's suggestion about multiple Excel STP files, your only real option is to create an ASCII file. Note that you can give the ASCII file an extension of *.CSV or even *.XLS, and Excel will read it right in.
So the question boils down to how to format the ASCII export correctly and quickly.
You can use the DAT file approach Ingo mentioned and even re-write the file with VBS to include a few header lines of your own choosing. Note that this approach does NOT support text channels. There is an example of this in the zip file attached below.
You can alternatively use the CSV export function in DIAdem 9.1 to output an ASCII file with the name of each channel as the single header row above all the values. There is an example of this in the zip file attached below.
You can also just read the values from the DIAdem channels and write them out to an ASCII file cell by cell, managing everything with VBScript calls. There is an example of this in the zip file attached below.
I hope that helps,
Brad Turpin
DIAdem Product Support Engineer
National Indstruments
Attachments:
DIAdem ASCII Export.zip 5 KB -
How to merge two cells in a row
hi freinds,
how to merge two cells in alv grid using oops.
for eg ,in the first row there is text premraj
n in the second row there is cheguri
my requriment is two merge the two cells ie to remove the horizontal line between them
thanks & regards,
premrajWell, as a new member you should learn to search the forum first before posting questions. Using keywords like "jtable merge cell" will find other postings on this topic. Some with solutions some without, so you will need to read a few and decide on the approach you want to take.
-
Adding row into existing CSV file using C#
How to add row to existing CSV file using .NET Code.the file should not be overwrite,it need add another row with data.how to implement this scenario.
Hi BizQ,
If you only just write some data to CSV file. Please follow A.Zaied and Magnus 's reply. In general,we use CSV file to import or export some data. Like following thread and a good article in codeproject
Convert a CSV file to Excel using C#
Writing a DataTable to a CSV file
Best regards,
Kristin
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
How to merge two Outlook 2010 pst data files?
How to merge two Outlook 2010 pst data files?
Easy way: with the one you want to use open in Outlook and the other one not in your profile, go to File, Open, Import.
If you only want to merge some content, open both pst files in outlook and drag between folders. For calendar, use a list view to see all of the appointments.
Diane Poremsky [MVP - Outlook]
Outlook Daily Tips |
Outlook & Exchange Solutions Center
Subscribe to Exchange Messaging Outlook weekly newsletter -
How to work with columns in CSV
How do i get the expected result form the existing data?and also i need to compare column a and d and place the resule in new column, the CSV file has more than 100000 Row.
Existing Data:
name
path
home
gk
\\ts
\\ts\gk
gjk
\\ts
\\ts\gjk
kfdk
\\ts
\\ts\kfdk
agtrf
\\ts
\\ts\agtrf
Expected Result:
name
path
home
Folder
gk1
\\ts
\\ts\gk~
gk~
gjk3
\\ts
\\ts\gjk
gjk
kfdk
\\ts
\\ts\kfdk
kfdk
agtrf
\\ts
\\ts\agtrf
agtrfAs I said earlier, it doesn't work because there is no folder component in the UNC paths in the "home" column.
A UNC path is \\Server\Share followed by the folder\file path within that share.
What you have there labeled "Folder" is actually a share name, which may or may not be the name of the folder being shared. What the OP requested after you posted the initial solution was how to split the folder name off of a \\server\share\folder
unc path.
I agree the split is faster. Based on that timing it will take the split-path method about 88 seconds go through 100K records, where the split method will take about 7 seconds.
But I'm willing to bet there's a lot more than that minute and change difference in the time it took to write those two scripts.
FWIW, for processing large text files you can usually get better results if you can leverage Get-Content with a ReadCount of 1-2000 files, and then use -replace as an array operator to do the text manipulation. This reduces your disk I/O operations
by a factor of -ReadCount while keeping memory utilization under control:
"gk","\\ts","\\ts\gk"
"gjk","\\ts","\\ts\gjk"
"kfdk","\\ts","\\ts\kfdk"
"agtrf,"\\ts","\\ts\agtrf"
'@ *25000).split("`n") |% {$_.trim()} | ac testfile.csv
$OldCsvPath = 'testfile.csv'
$NewCsvPath = 'testfile2.csv'
(measure-command {
$NotFirst = $false
get-content $OldCsvPath -ReadCount 1000 |
foreach {
if ($NotFirst) { $_ -replace '\\([^\\"]+")\s*$','\$1,"$1' }
else { $_ -replace '"home"\s*$','"home","folder"' -replace '\\([^\\"]+")\s*$','\$1,"$1' }
} | set-content $NewCsvPath
}).TotalSeconds
'*'*20
Get-Content $NewCsvPath -TotalCount 10
2.3213534
"name","path","home","folder"
"gk","\\ts","\\ts\gk","gk"
"gjk","\\ts","\\ts\gjk","gjk"
"kfdk","\\ts","\\ts\kfdk","kfdk"
"agtrf,"\\ts","\\ts\agtrf","agtrf"
"gk","\\ts","\\ts\gk","gk"
"gjk","\\ts","\\ts\gjk","gjk"
"kfdk","\\ts","\\ts\kfdk","kfdk"
"agtrf,"\\ts","\\ts\agtrf","agtrf"
"gk","\\ts","\\ts\gk","gk"
That's 2.3 seconds for the whole 100,000 rows.
[string](0..33|%{[char][int](46+("686552495351636652556262185355647068516270555358646562655775 0645570").substring(($_*2),2))})-replace " " -
How to load the data from .csv file to oracle table???
Hi,
I am using oracle 10g , plsql developer. Can anyone help me in how to load the data from .csv file to oracle table. The table is already created with the required columns. The .csv file is having about 10lakh records. Is it possible to load 10lakh records. can any one please tell me how to proceed.
Thanks in advance981145 wrote:
Can you tell more about sql * loader??? how to know that utility is available for me or not??? I am using oracle 10g database and plsql developer???SQL*Loader is part of the Oracle client. If you have a developer installation you should normally have it on your client.
the command is
sqlldrType it and see if you have it installed.
Have a look also at the FAQ link posted by Marwin.
There are plenty of examples also on the web.
Regards.
Al -
How to get DocSet property values in a SharePoint library into a CSV file using Powershell
Hi,
How to get DocSet property values in a SharePoint library into a CSV file using Powershell?
Any help would be greatly appreciated.
Thank you.
AA.Hi AOK,
Would you please post your current script and the issue for more effcient support.
In addition, to manage document set in sharepoint please refer to this script to start:
### Load SharePoint SnapIn
2.if ((Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue) -eq $null)
3.{
4. Add-PSSnapin Microsoft.SharePoint.PowerShell
5.}
6.### Load SharePoint Object Model
7.[System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”)
8.
9.### Get web and list
10.$web = Get-SPWeb http://myweb
11.$list = $web.Lists["List with Document Sets"]
12.
13.### Get Document Set Content Type from list
14.$cType = $list.ContentTypes["Document Set Content Type Name"]
15.
16.### Create Document Set Properties Hashtable
17.[Hashtable]$docsetProperties = @{"DocumentSetDescription"="A Document Set"}
18.$docsetProperties = @{"CustomColumn1"="Value 1"}
19.$docsetProperties = @{"CustomColum2"="Value2"}
20. ### Add all your Columns for your Document Set
21.
22.### Create new Document Set
23.$newDocumentSet = [Microsoft.Office.DocumentManagement.DocumentSets.DocumentSet]::Create($list.RootFolder,"Document Set Title",$cType.Id,$docsetProperties)
24.$web.Dispose()
http://www.letssharepoint.com/2011/06/document-sets-und-powershell.html
If there is anything else regarding this issue, please feel free to post back.
Best Regards,
Anna Wang
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact [email protected] -
How to save excel report as CSV file with ActiveX
Hi,
I'm trying to save my excel test report as a CSV file using ActiveX and I'm having difficulty getting started. I can't find an invoke node method that enables CSV file conversion.
Can anyone shed light on this? See attached screenshot.
Thanks
As long as you are using the Report Generation Toolkit, there is no need to use ActiveX for the purpose of saving the Excel file -- Save Report will do that for you. You can then export (as text) all of the Excel data and use the Write Spreadsheet File to make the .CSV file. Here is how I would rewrite the final bits of your code --
I cleaned up the wires around Excel Easy Table a bit. You'll see I made a VI Icon for Replace Filename, which does (I think) a nicer job of self-documenting than showing its Label. To make the filename, add the correct extension (.xlsx for Excel, .csv for CSV), use Build Path to combine Folder and Filename, and wire to Save Report.
The next two functions add the Extract Everything and Write to Spreadsheet, using a Comma as a separator, which makes a CSV copy for you.
Bob Schor -
SQL* Loader Loading specific column from CSV file to the table
Dear All,
Iam Loading specific column from .CSV file to the oracle table.
Could pls help how i can load only that cols into the table
Eg: CSV file having id, Frst_name,Last_name, Address,Phone,Insurance etc
out of this I want to load only Frst_name,Last_name columns to oracle table say fname and lname.
Thanks in Adv.
JunuLily,
I made some changes to your table def but you will get the idea
-- Table EMPLOYEE
CREATE TABLE EMPLOYEE
EMPID NUMBER NOT NULL,
EMPNICKNAME VARCHAR2(10 BYTE) NULL,
FNAME VARCHAR2(20 BYTE) NOT NULL,
MI VARCHAR2(20 BYTE) NULL,
LNAME VARCHAR2(20 BYTE) NOT NULL,
FULLNAME VARCHAR2(20 BYTE) NOT NULL,
HIREDATE DATE DEFAULT SYSDATE NOT NULL
-- data file employee.dat
1,amy,b,amy b
2,cindy,d,cindy d
3,eric,f,eric f
4,gary,h,gary
-- Control file : Employee.ctl ( you can use truncate, replace or append , see sqlldr for more options)
load data
Truncate into table employee
fields terminated by ","
optionally enclosed by '"'
TRAILING NULLCOLS
empId INTEGER EXTERNAL,
FName char(20),
LName char(20),
FullName char(30)
now to load use following or you can speicify infile in control fle
sqlldr username/passowrd control=employee.ctl data=employee.dat log=employee.log
{code}
Hope this help.
Regards -
[Help] How to merge two rows in a datagrid?
How to merge two rows of a specific column in a datagrid?
ex.
|_______|_____|_____|
| merged |_____|_____|
|_______|_____|_____|
|_______|_____|_____|
thx a lot~I need to merge column heading. Have u find any solution for
ur problem? -
How to add two columns in OBIEE report?
Hi to All,
Can anyone tell me how to add two columns in OBIEE report and get that result in a new column?
Thanks in Advance,
ThenmozhiAssume you already have two columns SalesAmt1 and SalesAmt2, and you want to derive 3rd column say SalesAmt3 which would be the sum of SalesAmt1 and SalesAmt2.
For this, as I mentioned above pull SalesAmt1 and SalesAmt2 columns in Report. Now pull another column (say SalesAmt1) and open the fx. Clear the contents of fx. Now locate the columns button in the bottom of the fx. From Here, first select SalesAmt1 and + sign and the select SalesAmt2.
Now in this new column, the fx should look like SalesAmt1 + SalesAmt2.
Let me know if you are looking for something else.
Thanks -
How to get Document Set property values in a SharePoint library in to a CSV file using Powershell
Hi,
How to get Document Set property values in a SharePoint library into a CSV file using Powershell?
Any help would be greatly appreciated.
Thank you.
AA.Hi,
According to your description, my understanding is that you want to you want to get document set property value in a SharePoint library and then export into a CSV file using PowerShell.
I suggest you can get the document sets properties like the PowerShell Command below:
[system.reflection.assembly]::loadwithpartialname("microsoft.sharepoint")
$siteurl="http://sp2013sps/sites/test"
$listname="Documents"
$mysite=new-object microsoft.sharepoint.spsite($siteurl)
$myweb=$mysite.openweb()
$list=$myweb.lists[$listname]
foreach($item in $list.items)
if($item.contenttype.name -eq "Document Set")
if($item.folder.itemcount -eq 0)
write-host $item.title
Then you can use Export-Csv PowerShell Command to export to a CSV file.
More information:
Powershell for document sets
How to export data to CSV in PowerShell?
Using the Export-Csv Cmdlet
Thanks
Best Regards
TechNet Community Support
Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
[email protected]
Maybe you are looking for
-
Is there a way to save a restored session (without opening it) to bookmarks?
I kinda get carried way with opening tabs, like I'll have 50-200 open at any time. And you can imagine what it's like when Firefox crashes and you attempt to restore a crashed session - all the tabs reopen at the same time. Is there any way to save a
-
Error while reading access data (URL, user,password) for the Adapter Engine
Hi, Any idea on below message? I am doing file to file scenario and got the below tarce from sxmb_moni. <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> - <!-- Call Adapter --> - <SAP:Error xmlns:SAP="http://sap.com/xi/XI/Message/30" xmlns
-
Printing reciepts in the cash journal
Am getting an Error message "You selected variant SAP18 for program RFKORD80. This variant does not exist." when i want to print a receipt in the cash journal. However all settings have been maintained in FBCJC3. Can you please suggest any possible s
-
IF there are two release strategy, How it will work?
Hi, Can u Please help, if we have two release strategy, and PO first gets blocked by one release strategy, if we release that PO and check for the another release strategy, it is possible in ABAP? and How? Which Function module or BAPI we have to us
-
I am new to servlet........... i hv installed Tomcat 4.1........it installed properly........there is no prob........ even there is no problem in compilation...............but when i gave...... http://local:8080/............ it will not display prope