Arranging data in excel by using any scripting language like VB, Java \
I need a help in arranging the data in first column into different columns according to equivalent row value.
for example.
Time
Name Class
Activity Subject
12 Feb 2014 10:00 AM Robert
5th School started
12 Feb 2014 10:30 AM Robert
5th Break
12 Feb 2014 11:00 AM Robert
5th Session Started
Science
12 Feb 2014 11:30 AM Edwin
5th School Started
12 Feb 2014 12:00 AM Edwin
5th Break
12 Feb 2014 01:00 PM Edwin
5th Session Started
Maths
Above Data to be arranged as mentioned below
Time A Time B
Time C
Name Class
Subject
12 Feb 2014 10:00 AM 12 Feb 2014 10:30 AM 12 Feb 2014 11:00 AM
Robert 5th
Science
12 Feb 2014 11:30 AM 12 Feb 2014 12:00 AM 12 Feb 2014 01:00 PM
Edwin 5th
Maths
As actual data is different and i cannot share the data here.. but i need to create a VB or Java or any language script for n number of above mentioned data to bring out the data into below format..
Please help me in finding out solution
Data from A1
VVBA Code:
Sub lk()
Dim wks As Worksheet: Set wks = ActiveSheet
Dim x&, y&: y = 2 '1st data row
Dim max_row&: max_row = wks.Cells(wks.Rows.Count, "a").End(xlUp).Row
Dim n_wks As Worksheet: Set n_wks = ActiveWorkbook.Worksheets.Add
'Headers
With n_wks.Cells(1, 1)
.Value = "Time A"
.Offset(, 1) = "Time B"
.Offset(, 2) = "Time C"
.Offset(, 3) = "Name"
.Offset(, 4) = "Class"
.Offset(, 5) = "Subject"
End With
'Pull datas i step
For x = 2 To max_row Step 3 'rows 2|5|8...
n_wks.Cells(y, 1).Value = wks.Cells(x, 1).Value
n_wks.Cells(y, 2).Value = wks.Cells(x + 1, 1).Value
n_wks.Cells(y, 3).Value = wks.Cells(x + 2, 1).Value
n_wks.Cells(y, 4).Value = wks.Cells(x, 2).Value
n_wks.Cells(y, 5).Value = wks.Cells(x, 3).Value
n_wks.Cells(y, 6).Value = wks.Cells(x + 2, 5).Value
y = y + 1
Next
End Sub
p.s.
Gallery is not for that ;] - use OneDrv, Dropbox, Or other
Oskar Shon, Office System MVP - www.VBATools.pl
if Helpful; Answer when a problem solved
Similar Messages
-
How to Write data in Excel File using java
Hi
can anybody help me to write data in excel file
using java code
Thankx In AdvanceHow much are you willing to pay for that?
If you want it for free, http://jexcelapi.sourceforge.net/ -
There is any Scripting languages is used for mobile application development
Is there is any Scripting languages is used for mobile application development?
For example java script,vb script is used for web development.Like that is there is any scripting language is used for mobile application development along with J2me.
Thanks & Regards, Sivakumar.J806437 wrote:
.. is there is any scripting language is used for mobile application development along with J2me.If you are talking about javax.script,
google ( [url http://www.google.com/search?q=java+me+javax.script]java me javax.script ) gave me http://sourceforge.net/projects/rhinoj2mecldc/ -
Trying to open iTunes - get an error message saying "This version of itunes has not been correctly localized for this language. Please run the english version" Saw other answers for windows users, I have a MacAir. never used any other language but English so I have no clue what the problem is. I just want to update my phone and back it up.
Let's try a repair install of iTunes.
Restart the PC first.
If you're using Vista or 7, now head into your Uninstall a program control panel, select "iTunes" and then click "Repair".
If you're using XP, head into your Add or Remove Programs control panel, select "iTunes", and click "Change". Select "Repair" and click "Next" as per the following screenshot:
Can you launch your iTunes now? -
Problems with updating data in excel spreadsheet using ODI
That's my first post on this forum, therefore I'd like to say Hello to everybody reading it before I present my problem.
First I configured the ODBC connection to the xls file which conteins my data - the file isn't defined as read-only in the ODBC connection. The next step was setting up a Microsoft Excel Data Server in the topology manager in which I inserted the physical model and of course a logical one referencing the physical one. These steps allowed me to insert a model with my table in the Designer - I can view data throug the option 'view data' appearing after the right-click on the datastore. One of the columns was defined as primary key in constraints. I can use this xls file datastore as a source in an interface - loading the target finishes with a success. But I can't update the data in the xls file using the 'data' option appearing after right-click on the datastore correspondig to it in the designer. The new window with data from file appears without any problem, but when I try to update any of the fields I recieve an error:
*"See com.borland.dx.dataset.DataSetException error code: BASE+37*
*com.borland.dx.dataset.DataSetException: DataSet has no unique row identifiers.*
*Note: For QueryDataSets you need to disable metaDataUpdate.ROWID in the MetaDataUpdate property, in addition to setting the RowId property on a column.* - don't know where to configure it
at com.borland.dx.dataset.DataSetException.c(Unknown Source)
at com.borland.dx.dataset.DataSetException.kb(Unknown Source)
at com.borland.dx.dataset.StorageDataSet.fb(Unknown Source)
at com.borland.dx.dataset.StorageDataSet.a(Unknown Source)
at com.borland.dx.dataset.DataSet.startEditCheck(Unknown Source)
at com.borland.dx.dataset.DataSet.startEdit(Unknown Source)
at com.borland.dbswing.TableMaskCellEditor.textModified(TableMaskCellEditor.java:340)
at com.borland.dbswing.TableMaskCellEditor.insertUpdate(TableMaskCellEditor.java:319)
at javax.swing.text.AbstractDocument.fireInsertUpdate(Unknown Source)
at javax.swing.text.AbstractDocument.handleInsertString(Unknown Source)
at javax.swing.text.AbstractDocument.insertString(Unknown Source)
at javax.swing.text.PlainDocument.insertString(Unknown Source)
at com.borland.dbswing.DBPlainDocument.insertString(DBPlainDocument.java:77)
at javax.swing.text.AbstractDocument.replace(Unknown Source)
at javax.swing.text.JTextComponent.replaceSelection(Unknown Source)
at javax.swing.text.DefaultEditorKit$DefaultKeyTypedAction.actionPerformed(Unknown Source)
at javax.swing.SwingUtilities.notifyAction(Unknown Source)
at javax.swing.JComponent.processKeyBinding(Unknown Source)
at javax.swing.JComponent.processKeyBindings(Unknown Source)
at javax.swing.JComponent.processKeyEvent(Unknown Source)
at com.borland.dbswing.TableMaskCellEditor.processKeyEvent(TableMaskCellEditor.java:627)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.KeyboardFocusManager.redispatchEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.preDispatchKeyEvent(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.typeAheadAssertions(Unknown Source)
at java.awt.DefaultKeyboardFocusManager.dispatchEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)"
What should I do to be able to modify data from the xls file that way (is it possible in any way)?It is not possible to update the data directly from ODI on some technologies, mainly due to some driver limitations.
I would suggest to edit the spreadsheet in Excel.
Thanks,
Julien -
I have created a OData Connection to my Library and published to SharePoint online site.
To refresh the data, property is set like "Refresh when opening file"
When I downloaded and open the file, the new data is consumed to me successfully because this ODF file referenced to my local computer
If any other user downloads the file its not opening as reference file points to my local machine.
I want to keep this ODF file in "Data connections" Library (or in any site/Library) and establish the connection to the excel sheet. so that any one can use the ODF file.
or else any other alternative to use ODF file globally and get the SP Library data to excel ?Hi,
it will use the connection in the ADF library. I recommend though that you not save database connect information in the ADF library. Instead:
- define the ADF BC model to use JDBC data sources
- In the ADF library, configure it to only contain the data source name
- In the view project (the workspace) configure the database connection exposed by the library
When the library is imported, check Application Resources --> Connections and right click on the imported connection name to configure it
Frank -
Export the Form Data to Excel File using FILE EXPORT
One problem i am getting...
I want to export printers page to some excel file using FILE > EXPORT option.
I login into System Administrator Responsibility > printers > register...
I want to export this printers data to flat file(EXCEL File) using FILE > EXPORT in the form...
The movement I click FILE > EXPORT...a flash screen appears and disapperas...nothing will be exported...
What Might be the problem...
How can I solve this...
My FND_LOBS_CTX index is fine..it is valid and- Check the security level of the "Trusted sites" zone, make sure it is set to "Low"
- Make sure you do not have a yellow warning bar
- Make sure you are not accessing the application through dev60cgi/f60cgi
- Verify that you have sufficient space in the tablespace (Check init<SID>.ora for any errors)
- Check the export on some other modules to determine whether the issue is across all Apps or with a specific module only -
Facing problem in writing data to excel sheet using ActiveX
Hi.
I want to write data from a one dimesional array to a particular excel sheet in a particular row.Please see the attached vi for explantion.
It is giving error.But If I give a new file name when the appliation is getting closed it is writing data to the new excel file.
Please help.
Thanks in advance
Attachments:
Excel sheetWrite.vi 90 KBThanks Jhoskin and Rudi .......
I am able to write data to excel sheet now. I am attaching one"test.zip" file that contains a VI named "Squence.vi "that contains another subVI named "Write U94006 Table To XL.vi"which does the functionality of counting the number of rows in the excel sheet and writing data in the next blank row. I am using the same subVI in the VI named "Sequence.vi"two times so it is taking a lot of time in opening and closing the excel sheet. Will you please suggest some way of calling the subVI only one time.
Rikki
Attachments:
Test.zip 105 KB -
Anyway to automate the settings of rpd using any script
I need a small help like every after installing the BI apps, have to go to admin tool and manually configure the settings. Is there any way to automate the process using any API or scripting language.??
awaiting for ur replyVery odd that you've made a post and then marked is as answered before even receiving an reply ?:|
Anyway... you've posted in the wrong forum...
>
Forum: Community Feedback and Suggestions (Do Not Post Product-Related Questions Here)
Use this forum for feedback about OTN programs, Web site content, and systems - product-related questions will be deleted. -
How to export sql table data to Excel/PDf using Storedprocedure?
Hi ,
I have one table in sqlserver2008R2 that named "Customer" so that table hold the 1 Lac rows. Now I want send this table data to Excel/pdf with Columns using Storedprocedure.
I have tried this using xp_cmdshell so This is not working for me.
finally i want to get data in Excel and pdf also.
Please guide meYou can actually run an Excel Macro to grab the data from the SQL Server DB. Below are some samples.
Sub ADOExcelSQLServer()
' Carl SQL Server Connection
' FOR THIS CODE TO WORK
' In VBE you need to go Tools References and check Microsoft Active X Data Objects 2.x library
Dim Cn As ADODB.Connection
Dim Server_Name As String
Dim Database_Name As String
Dim User_ID As String
Dim Password As String
Dim SQLStr As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Server_Name = "Excel-PC\SQLEXPRESS" ' Enter your server name here
Database_Name = "Northwind" ' Enter your database name here
User_ID = "" ' enter your user ID here
Password = "" ' Enter your password here
SQLStr = "SELECT * FROM dbo.Orders" ' Enter your SQL here
Set Cn = New ADODB.Connection
Cn.Open "Driver={SQL Server};Server=" & Server_Name & ";Database=" & Database_Name & _
";Uid=" & User_ID & ";Pwd=" & Password & ";"
rs.Open SQLStr, Cn, adOpenStatic
' Dump to spreadsheet
With Worksheets("sheet1").Range("a1:z500") ' Enter your sheet name and range here
.ClearContents
.CopyFromRecordset rs
End With
' Tidy up
rs.Close
Set rs = Nothing
Cn.Close
Set Cn = Nothing
End Sub
Sub ADOExcelSQLServer()
Dim Cn As ADODB.Connection
Dim Server_Name As String
Dim Database_Name As String
Dim User_ID As String
Dim Password As String
Dim SQLStr As String
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
Server_Name = "LAPTOP\SQL_EXPRESS" ' Enter your server name here
Database_Name = "Northwind" ' Enter your database name here
User_ID = "" ' enter your user ID here
Password = "" ' Enter your password here
SQLStr = "SELECT * FROM Orders" ' Enter your SQL here
Set Cn = New ADODB.Connection
Cn.Open "Driver={SQL Server};Server=" & Server_Name & ";Database=" & Database_Name & _
";Uid=" & User_ID & ";Pwd=" & Password & ";"
rs.Open SQLStr, Cn, adOpenStatic
With Worksheets("Sheet1").Range("A2:Z500")
.ClearContents
.CopyFromRecordset rs
End With
rs.Close
Set rs = Nothing
Cn.Close
Set Cn = Nothing
End Sub
Sub TestMacro()
' Create a connection object.
Dim cnPubs As ADODB.Connection
Set cnPubs = New ADODB.Connection
' Provide the connection string.
Dim strConn As String
'Use the SQL Server OLE DB Provider.
strConn = "PROVIDER=SQLOLEDB;"
'Connect to the Pubs database on the local server.
strConn = strConn & "DATA SOURCE=(local);INITIAL CATALOG=NORTHWIND.MDF;"
'Use an integrated login.
strConn = strConn & " INTEGRATED SECURITY=sspi;"
'Now open the connection.
cnPubs.Open strConn
' Create a recordset object.
Dim rsPubs As ADODB.Recordset
Set rsPubs = New ADODB.Recordset
With rsPubs
' Assign the Connection object.
.ActiveConnection = cnPubs
' Extract the required records.
.Open "SELECT * FROM Categories"
' Copy the records into cell A1 on Sheet1.
Sheet1.Range("A1").CopyFromRecordset rsPubs
' Tidy up
.Close
End With
cnPubs.Close
Set rsPubs = Nothing
Set cnPubs = Nothing
End Sub
Finally, you can run a SProc in SQL Server, from Excel, if you want the SProc to do the export.
Option Explicit
Sub Working2()
'USE [Northwind]
'GO
'DECLARE @return_value int
'EXEC @return_value = [dbo].[TestNewProc]
' @ShipCountry = NULL
'SELECT 'Return Value' = @return_value
'GO
Dim con As Connection
Dim rst As Recordset
Dim strConn As String
Set con = New Connection
strConn = "Provider=SQLOLEDB;"
strConn = strConn & "Data Source=LAPTOP\SQL_EXPRESS;"
strConn = strConn & "Initial Catalog=Northwind;"
strConn = strConn & "Integrated Security=SSPI;"
con.Open strConn
'Put a country name in Cell E1
Set rst = con.Execute("Exec dbo.TestNewProc '" & ActiveSheet.Range("E1").Text & "'")
'The total count of records is returned to Cell A5
ActiveSheet.Range("A5").CopyFromRecordset rst
rst.Close
con.Close
End Sub
Sub Working()
'USE [Northwind]
'GO
'DECLARE @return_value int
'EXEC @return_value = [dbo].[Ten Most Expensive Products]
'SELECT 'Return Value' = @return_value
'GO
Dim con As Connection
Dim rst As Recordset
Set con = New Connection
con.Open "Provider=SQLOLEDB;Data Source=LAPTOP\SQL_EXPRESS;Initial Catalog=Northwind;Integrated Security=SSPI;"
Set rst = con.Execute("Exec dbo.[Ten Most Expensive Products]")
'Results of SProc are returned to Cell A1
ActiveSheet.Range("A1").CopyFromRecordset rst
rst.Close
con.Close
End Sub
Knowledge is the only thing that I can give you, and still retain, and we are both better off for it. -
Can not use any remote desktop like VNC after installing Oracle Linux 6.3
Hi
I just installed OL 6.3 on a HP Proliant ML380 g7. Now I want to connect to the server using any Remote Desktop tools but I can not!
I've activated system>pref>Remote Desktop
But I can not access any of servers from:
- a Mac using, Mac server sharing screen, VNC viewer or Microsoft Remote connection which is in a same subnet
- Other Server Using KRDC, Remote Desktop Viewer, terminal server client or tiger VNC viewer
Also I tried to connect to servers after activating krfb
but it always says no rout to server/ server not found/ connection closed
and remote desktop viewer can not find any host when I try to use option "find"
Please Advise
Thank you in advanceMake sure to enable "require a password..." in the Remote Desktop Preference on the Linux system. Some clients won't work unless this is set. Unfortunately the Remote Desktop Preferences panel on the Linux side does not show you the port it is listening on, but you can get it by clicking on the IP or name that it shows as a link. The first user or vnc server is usually listening on port 5900, then 5901, and so on.
Your problem is probably the firewall on your Linux system. You can disable the firewall on the Linux system:
service iptables stop
However, probably a better idea, simply tunnel the connection through SSH as following:
On the Mac, open the Terminal application from the Applications/Utilities folder. Then type the following:
<pre>
ssh -L local_port:localhost:remote_port -N -f -l username server_address
</pre>
local_port = port on your Mac that does not conflict with any of your own screen-sharing or other services, e.g. 5555
remote_port = vnc server port on your Linux system
username = user for which you have enabled remote desktop sharing
server_address = ip address or FQDN of your Linux system.
For instance:
<pre>
ssh -L 5555:localhost:5900 -N -f -l root 10.0.1.2
</pre>
The trick is now to connect to a local port on your Mac, instead using the address of your Linux server. The communication will be encrypted using ssh going over tcp port 22, which is normally enabled in the firewall.
The Mac screen sharing application is working fine. On your Mac, select "Go>Connect to Server" from the Finder menu and type:
vnc://localhost:5555 -
Using a foreign language with the Java I/O, and saving to flat file.
I want to use a foreign language in my program, in particular, russian. I want to be able to input the russian text into a GUI and then save the data in a flat file as well as retrieve it again. I am able to save some type of data to the flat file but it is unreadable. Question marks or some other unreadable characters appear instead.
I am also not able to write in a foreign font. Can someone give me some advice for how to input a foreign language into with a GUI, save the information in a flat file, and retrieve it again.If you have got a String in Java somehow regardless of interior encoding mode, you can write it in a text file with an encoding you would like (e.g., UTF8).
//import java.io.*;
String str = "ABCEDFG";
try{
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream("out.txt"),"UTF8"));
bw.write(str);
bw.close();
}catch(IOException ioe){
//process
} -
Hi,
I am Using BAPI_ACC_MANUAL_ALLOC_POST (Manual cost allocation) for uploading into database. But i am getting the error "DO NOT USE COST ELEMENT xxxxxxxx FOR REPOST COSTS".
can anyone explain me the possible reasons for this error.
any help will be rewarded.
Thanks and Regards,
Gautham PaspalaHi,
Refer to the following code:
DATA: lv_filetype(10) TYPE c,
lv_gui_sep TYPE c,
lv_file_name TYPE string.
lv_filetype = 'ASC'.
lv_gui_sep = 'X'.
lv_file_name = pa_dfile.
FM call to upload file
CALL FUNCTION 'GUI_UPLOAD'
EXPORTING
filename = lv_file_name
filetype = lv_filetype
has_field_separator = lv_gui_sep
TABLES
data_tab = gi_zhralcon_file
EXCEPTIONS
file_open_error = 1
file_read_error = 2
no_batch = 3
gui_refuse_filetransfer = 4
invalid_type = 5
no_authority = 6
unknown_error = 7
bad_data_format = 8
header_not_allowed = 9
separator_not_allowed = 10
header_too_long = 11
unknown_dp_error = 12
access_denied = 13
dp_out_of_memory = 14
disk_full = 15
dp_timeout = 16
OTHERS = 17.
IF sy-subrc <> 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
The excel file must be a tab delimited file.
Hope it helps.
Regards,
Rajesh Kumar -
Oracle function to extract data into excel sheet within a script
I have extracted data from a couple of tables onto a view. Basically I have got about 15 coloums in that view but i need to extract the data in the view into an Excel sheet.
I just want to know if their is a function in oracle whereby i can export the data in the view onto an excel sheet, because this statements is going to be scripted and run every morning for the data to be processed.
Oracle version: oracle 9i
OS : Windows 2003If this is a one-off then IDEs such as TOAD typically
let you export the results of a query in an
appropriate format for Excel.Note:
because this statements is going to be scripted and run
every morning for the data to be processedSo that won't be feasible in this case, but it was a good point to make. -
When I am on 3G on iMessege, does it use all my data while iMesseging or use any money?
Hi, I was wondering if when I can't connect to wifi, and I turn 3G on does it use all my data or money to iMessage?
If you use iMessage you use your data plan or wifi.
If you don't want to use your data plan and turn off iMessage in the settings
so you can use your text plan.
Maybe you are looking for
-
Photos missing when syncing from iPhoto to iPod touch 3G
OK, I'm trying to upload photos from iPhoto to my G3 iPod Touch. They're in a specific album within a folder. There are 84 pictures in the album, but only 32 are uploading. Anyone know why?
-
MR11 - GRIR clearing for account assigned PO.
Hi Folks, I have a doubt on MR11 Account Maintenance for account assigned C - Sales order PO and GR non Valuated. In this system is not allowing to Post AccM. document as the GR posting is not hitting GRIR clearing account and the same is happening
-
IMSS Min Normalized Measure not appearing in imsmanifest.xml file
Hello, The IMSS Min Normalized Measure line is not appearing in my imsmanifest.xml file. It used to, but since I upgraded to Captivate 5.5, I don't see it anymore. I have thoroughly checked my settings: Reporting is enabled SCORM 2004/Manifest/Defaul
-
TestStand 4.0 reportgen_html.seq Type Conflict
We have converted from TestStand 3.5 to TestStand 4.0. We had created a custom reportgen_html.seq in TestStand 3.5 which we copied over to the TestStand 4.0\Components\User\Models\TestStandModels directory and updated using the Update Sequence Files
-
Auto consumption of Q stock from an STO?
Hi All How much configuration is required to enable auto consumption to a reservation for receipt of Q stock for a stock transport order. The reservations are for Q stock only. Therefore, Plant B supplies Plant A with Q stock that I want to be receip