Rename files using text or excel file
I am trying to find out how to rename files on my pc using the names stored in a text document
eg. the file on the pc is called "C07_08.dat"
the text file has the following line "3am Eternal KLF 03:15 121 BMG C07.08"
i want to change the name of the file "C07_08.dat" to "3am Eternal.mpeg"
What I would like is a batch file or program or something that will see the text "C07.08" and find the corresponding file "C07_08.dat" and rename it "3am Eternal.mpeg"
I have managed to create a excel document that has the information in four separate columns
Column A has the name of the file I want to use (ie. 3am Eternal) Column B & C have unneeded information and Column D has the file reference (ie. C07.08)
I was told that Python or Visual basic could do this so I downloaded them but I have no experience with this so im lost as to what to do, I have over 1800 of these files so doing it file by file will take quite a while.
I have included a sample of the text file for reference if that helps
3am Eternal KLF 03:15 121 BMG C07.08
4 In The Morning Gwen Stefani 04:22 092 UMA HD1.10
4 Minutes Madonna ft J Timberlake 04:04 113 WAR HE3.05
5 6 7 8 Steps 03:24 000 BMG C48.03
5678 Steps 03:23 140 MUS H16.02
6 Of 1 Thing Craig David 03:15 116 WAR HE2.11
60 MPH New Order 03:51 125 WAR N57.11
7 Days Craig David 04:30 084 SHO N41.16
7 Things Miley Cyrus 03:29 107 EMI HE7.09
99 Luft Balloons Nena 03:58 095 WAR C27.10
99 Times Kate Voegele 03:27 112 UMA HG6.07
A Girl Like You Edwyn Collins 03:47 126 MDS R06.08
A Little Bit Pandora 03:35 132 UMA H23.01
A Little Less Conversation Elvis VS JXL 03:02 115 BMG H68.03
A Matter Of Trust Billy Joel 04:00 110 SON C59.11
A New Day Has Come Celine Dion 04:20 092 SON H65.20
A Woman Like You Mondo Rock 04:03 169 MUS R06.01
About You Now Sugababes 03:32 083 UMA HD5.08
Absolutely Everybody Vanessa Amorosi 03:52 124 TRA H40.06
Absolutely Fabulous Pet Shop Boys 03:45 132 EMI C15.02
Accidentally In Love Counting Crows 03:08 138 UMA H94.05
According To You Orianthi 03:18 066 UMA HG4.12
Achy Breaky Heart Billy Ray Cyrus 03:55 122 SON K11.02
Here are two VBScripts that will rename the files based on the text file example you provided. The script that reads a
TEXT FILE requires each entry to be separated by
ONE TAB because it is the
TAB
that it uses to split each line into 4 parts (part1 - old file name, part2 and part3 - items you don’t need, part 4 - new file name). If there is more that one tab then the Split Function will not work properly.
The second VBScript will read the
EXCEL FILE row by row and use the values in Column A for the old file name and
Column D for the new file name. This approach will work much better if you have an excel document setup like this.
I used your example that you provided and it test fine for both approaches.
'Read text file
Dim objFSO, objFolder, inFile, strInLine, strOldFile, strNewFile
Set objFSO = CreateObject("Scripting.FileSystemObject")
'Select the folder
Set objFolder = objFSO.GetFolder("C:\Scripts\MusicFiles")
'Open Text File
Set inFile = objFSO.OpenTextFile("C:\Scripts\MusicFiles.txt",1)
Do Until inFile.AtEndOfStream
'Read text file line by line and Split each line into 4 parts.
strInLine = Split(inFile.ReadLine, vbTab)
'Old File name
strOldFile = strInLine(3)
'new File name
strNewFile = strInLine(0)
'Loop through the files in the folder
For Each File In objFolder.Files
'If the file name matches the old file name above
If File.Name = strOldFile & ".dat" Then
'Replace it
File.Name = strNewFile & ".mpeg"
End If
Next
Loop
'Close the text reader
inFile.Close
MsgBox "Done."
'Read Excel file
Dim objFSO, objExl, objFolder, objWorkbook, strOldFile, strNewFile, intRow
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objExl = CreateObject("Excel.Application")
'Select the folder
Set objFolder = objFSO.GetFolder("C:\Scripts\MusicFiles")
'Open the Excel file
Set objWorkbook = objExl.Workbooks.Open("C:\Scripts\MusicFiles.xls")
'Start at row 1
intRow = 1
'Read each Row until the end
Do Until objExl.Cells(intRow,1).Value = ""
'Old file name is in column 4
strOldFile = objExl.Cells(intRow, 4).Value
'New file name is in column 1
strNewFile = objExl.Cells(intRow, 1).Value
'Loop through each file in the selected folder
For Each File In objFolder.Files
'If the file name matches the old file name above
If File.Name = strOldFile & ".dat" Then
'Replace it
File.Name = strNewFile & ".mpeg"
End If
Next
'Increment each row
intRow = intRow + 1
Loop
'Close Excel
objExl.Quit
MsgBox "Done."
v/r LikeToCode....Mark the best replies as answers.
Similar Messages
-
Reading long text from excel file to an internal table
Hi
Can any body tell me how to read long text from excel file to an internal table.
When i am using this FM KCD_EXCEL_OLE_TO_INT_CONVERT then it is reading only 32 characters from each cell.
But in my excel sheet in one of the cell has very long text which i need to upload into a internal table.
may i know which FM or what logic i need to use for this problem.
RegardsHi,
Here is an example program. It will upload an Excel file with two columns. You could also assign the Excel structure dynamically, but I wanted to keep the example simple. The main point is that the internal table (it_excel in this example) must match the Excel structure that you want to convert.
Remember, this is just an example to help you figure out how to properly use the technique. It will certainly need to be modified to fit your requirements, and as always there may be a better way to get the Excel converted... this is just one possibility that has worked for me in the past.
*& Report zexcel_upload_test *
REPORT zexcel_upload_test.
TYPE-POOLS: truxs.
TYPES: BEGIN OF ty_excel,
col_a(10) TYPE n,
col_b(35) TYPE c,
END OF ty_excel.
DATA: l_data_tab TYPE TABLE OF string,
l_text_data TYPE truxs_t_text_data,
l_gui_filename TYPE string,
it_excel TYPE TABLE OF ty_excel.
FIELD-SYMBOLS: <wa_excel> TYPE ty_excel.
PARAMETERS: p_file TYPE rlgrap-filename.
* Pass the file name in the correct format
l_gui_filename = p_file.
* Upload data from PC
CALL METHOD cl_gui_frontend_services=>gui_upload
EXPORTING
filename = l_gui_filename
filetype = 'ASC'
has_field_separator = 'X'
CHANGING
data_tab = l_data_tab
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 ...
EXIT.
ENDIF.
* Convert from Excel into the appropriate itab
l_text_data[] = l_data_tab[].
CALL FUNCTION 'TEXT_CONVERT_XLS_TO_SAP'
EXPORTING
i_field_seperator = 'X'
i_tab_raw_data = l_text_data
i_filename = p_file
TABLES
i_tab_converted_data = it_excel
EXCEPTIONS
conversion_failed = 1
OTHERS = 2.
IF sy-subrc <> 0.
* MESSAGE ...
EXIT.
ENDIF.
LOOP AT it_excel ASSIGNING <wa_excel>.
* Do something here...
ENDLOOP.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR p_file.
PERFORM filename_get CHANGING p_file.
* FORM filename_get *
FORM filename_get CHANGING p_in_file TYPE rlgrap-filename.
DATA: l_in_file TYPE string,
l_filetab TYPE filetable,
wa_filetab TYPE LINE OF filetable,
l_rc TYPE i,
l_action TYPE i,
l_init_dir TYPE string.
* Set the initial directory to whatever you want it to be
l_init_dir = 'C:\'.
* Call the file open dialog without multiselect
CALL METHOD cl_gui_frontend_services=>file_open_dialog
EXPORTING
window_title = 'Load file'
default_extension = '.XLS'
default_filename = l_in_file
initial_directory = l_init_dir
multiselection = 'X'
CHANGING
file_table = l_filetab
rc = l_rc
user_action = l_action
EXCEPTIONS
file_open_dialog_failed = 1
cntl_error = 2
error_no_gui = 3
OTHERS = 4.
IF sy-subrc <> 0.
REFRESH l_filetab.
ENDIF.
* Read the selected filename
READ TABLE l_filetab INTO wa_filetab INDEX 1.
IF sy-subrc = 0.
p_in_file = wa_filetab-filename.
ENDIF.
ENDFORM. " filename_get
Regards,
Jamie -
Build Array and Output Values to Text or Excel File
I know this is a simple question but I need some help. I'm reading a DC voltage in LabVIEW a while loop. I want to store all the read values into an array and export that array as an text or Excel file. I had a VI that I build before for this but I cannot seem to find it and I can't remember how I did it before. Any help is appreciated. I think I can do the exporting part but I do help with building the array (storing all the data values).
I run into a problem while using the "Write to Text File Function". Initially I took about 60 measurements and wrote to a text file. That works but I increased the amount of measurements to be taken to 600 and when I did that the output in the text file are all Chinese letters (or that's what it seems like). Is this because I'm writing too much data?
When I use the "Write To Spreadsheet File VI" to write the measurments it works fine for the 600 measurements. The problem with this is I cannot insert any text. Using the "Write to Text File Function" I inserted some text before the measurements and "end of lines", to format the data. Attached is a screenshot of my VI.
Attachments:
measurements.PNG 45 KB -
Can 'GUI_UPLOAD' to be used to upload excel file lonely?
Hi experts,
I wonder that can 'GUI_UPLOAD' to be used to upload excel file lonely. I tried and use 'asc' as the L_FILETYPE, but the data uploaded contain many '###yyy'. But if I save the excel file as a txt file,
the data can be uploaded by 'GUI_UPLOAD' correctly. So what is the problem?Excel files be can't uploaded using "GUI_UPLOAD".
Use the FM "ALSM_EXCEL_TO_INTERNAL_TABLE"
Try this code:
* Upload data direct from excel.xls file to SAP
REPORT ZEXCELUPLOAD.
PARAMETERS: filename LIKE rlgrap-filename MEMORY ID M01,
begcol TYPE i DEFAULT 1 NO-DISPLAY,
begrow TYPE i DEFAULT 1 NO-DISPLAY,
endcol TYPE i DEFAULT 100 NO-DISPLAY,
endrow TYPE i DEFAULT 32000 NO-DISPLAY.
* Tick don't append header
PARAMETERS: kzheader AS CHECKBOX.
DATA: BEGIN OF intern OCCURS 0.
INCLUDE STRUCTURE alsmex_tabline.
DATA: END OF intern.
DATA: BEGIN OF intern1 OCCURS 0.
INCLUDE STRUCTURE alsmex_tabline.
DATA: END OF intern1.
DATA: BEGIN OF t_col OCCURS 0,
col LIKE alsmex_tabline-col,
size TYPE i.
DATA: END OF t_col.
DATA: zwlen TYPE i,
zwlines TYPE i.
DATA: BEGIN OF fieldnames OCCURS 3,
title(60),
table(6),
field(10),
kz(1),
END OF fieldnames.
* No of columns
DATA: BEGIN OF data_tab OCCURS 0,
value_0001(50),
value_0002(50),
value_0003(50),
value_0004(50),
value_0005(50),
value_0006(50),
value_0007(50),
value_0008(50),
value_0009(50),
value_0010(50),
value_0011(50),
value_0012(50),
value_0013(50),
value_0014(50),
value_0015(50),
value_0016(50),
value_0017(50),
value_0018(50),
value_0019(50),
value_0020(50),
value_0021(50),
value_0022(50),
value_0023(50),
value_0024(50),
value_0025(50),
value_0026(50),
value_0027(50),
value_0028(50),
value_0029(50),
value_0030(50),
value_0031(50),
value_0032(50),
value_0033(50),
value_0034(50),
value_0035(50),
value_0036(50),
value_0037(50),
value_0038(50),
value_0039(50),
value_0040(50),
value_0041(50),
value_0042(50),
value_0043(50),
value_0044(50),
value_0045(50),
value_0046(50),
value_0047(50),
value_0048(50),
value_0049(50),
value_0050(50),
value_0051(50),
value_0052(50),
value_0053(50),
value_0054(50),
value_0055(50),
value_0056(50),
value_0057(50),
value_0058(50),
value_0059(50),
value_0060(50),
value_0061(50),
value_0062(50),
value_0063(50),
value_0064(50),
value_0065(50),
value_0066(50),
value_0067(50),
value_0068(50),
value_0069(50),
value_0070(50),
value_0071(50),
value_0072(50),
value_0073(50),
value_0074(50),
value_0075(50),
value_0076(50),
value_0077(50),
value_0078(50),
value_0079(50),
value_0080(50),
value_0081(50),
value_0082(50),
value_0083(50),
value_0084(50),
value_0085(50),
value_0086(50),
value_0087(50),
value_0088(50),
value_0089(50),
value_0090(50),
value_0091(50),
value_0092(50),
value_0093(50),
value_0094(50),
value_0095(50),
value_0096(50),
value_0097(50),
value_0098(50),
value_0099(50),
value_0100(50).
DATA: END OF data_tab.
DATA: tind(4) TYPE n.
DATA: zwfeld(19).
FIELD-SYMBOLS: <fs1>.
AT SELECTION-SCREEN ON VALUE-REQUEST FOR filename.
CALL FUNCTION 'KD_GET_FILENAME_ON_F4'
EXPORTING
mask = '*.xls'
static = 'X'
CHANGING
file_name = filename.
START-OF-SELECTION.
CALL FUNCTION 'ALSM_EXCEL_TO_INTERNAL_TABLE'
EXPORTING
filename = filename
i_begin_col = begcol
i_begin_row = begrow
i_end_col = endcol
i_end_row = endrow
TABLES
intern = intern
EXCEPTIONS
inconsistent_parameters = 1
upload_ole = 2
OTHERS = 3.
IF sy-subrc <> 0.
WRITE:/ 'Upload Error ', SY-SUBRC.
ENDIF.
END-OF-SELECTION.
LOOP AT intern.
intern1 = intern.
CLEAR intern1-row.
APPEND intern1.
ENDLOOP.
SORT intern1 BY col.
LOOP AT intern1.
AT NEW col.
t_col-col = intern1-col.
APPEND t_col.
ENDAT.
zwlen = strlen( intern1-value ).
READ TABLE t_col WITH KEY col = intern1-col.
IF sy-subrc EQ 0.
IF zwlen > t_col-size.
t_col-size = zwlen.
* Internal Table, Current Row Index
MODIFY t_col INDEX sy-tabix.
ENDIF.
ENDIF.
ENDLOOP.
DESCRIBE TABLE t_col LINES zwlines.
SORT intern BY row col.
IF kzheader = 'X'.
LOOP AT intern.
fieldnames-title = intern-value.
APPEND fieldnames.
AT END OF row.
EXIT.
ENDAT.
ENDLOOP.
ELSE.
DO zwlines TIMES.
WRITE sy-index TO fieldnames-title.
APPEND fieldnames.
ENDDO.
ENDIF.
SORT intern BY row col.
LOOP AT intern.
IF kzheader = 'X'
AND intern-row = 1.
CONTINUE.
ENDIF.
tind = intern-col.
CONCATENATE 'DATA_TAB-VALUE_' tind INTO zwfeld.
ASSIGN (zwfeld) TO <fs1>.
<fs1> = intern-value.
AT END OF row.
APPEND data_tab.
CLEAR data_tab.
ENDAT.
ENDLOOP.
CALL FUNCTION 'DISPLAY_BASIC_LIST'
EXPORTING
file_name = filename
TABLES
data_tab = data_tab
fieldname_tab = fieldnames.
*-- End of Program -
More than 1 line of text when using text generator from file?
hi
have 8 line blocks of text to show onscreen.
would like to use text generatorn>from file
all they seem to print is one line.
is there a work around?
have trhied soft returns and paragraphs on saved text file.
no change.
anyonre know how to get 2 or more lines of text?
thanks in addvance!Select the File generator layer and in the Inspector, select the Layout pane and in Layout controls, set the Layout Method to Paragraph. Narrow your margins and the text will "flow" into multiple lines.
You can also keyframe the paragraph layout position. [Probably more info than you want here.]
That said, you can only display *one line* at a time per File Generator. (If you're up to date with Motion [v5.1.2], you can use more than one File generator.) The generator does not accept any other characters for returns other than newline and carriage return.
I've never tried it, but thinking about it, you can set Tab stops in the Paragraph layout (double click in the layout rectangle and a ruler should appear over the top -- right click on the ruler to set tabs). If you go back into the original text file and where you need to break lines into two or more, setting a left tab stop in the layout very near the end of a line might force the tabbed text into the next line (did I make that clear enough??) -
Jar files required to read excel file in SAP PI 7.3.1 sp09 dualstack
Hi experts,
I need to read excel file (.xls) using SAP PI and process it to target system. I have read blogs
and found that there are 2 ways to read an excel file in PI using file adapter.
1) Developing a custom adapter module
2) Using XSLT code.
So in order to develop a custom adapter module, i have followed the following blogs
**************** - XI - Step-by-step guide to develop Adapter Module to read Excel file
and
Excel Files - How to handle them in SAP XI/PI (The Alternatives)
and
http://wiki.scn.sap.com/wiki/display/ABAP/Adapter+Module+To+Read+Excel+File+with+Multiple+Rows+and+Multiple+Columns
I am unable to find the jar files in SAP PI at OS level as per the first blog(think they were obsolete).
Please let me know
1) What are the required jar files needed to read excel file and their location
2) Even if i use the old jar files as mentioned in the first blog can i achieve my requirement
3) Following this blog Convert incoming XML to Excel or Excel XML – Part 1 - XSLT Way if i apply the same logic at sender side, will it work? Because through case studies i came to know that we cannot read a .xls file using XSLT code. Correct me if i am wrong.
Looking for your valuable suggestions.
Regards
ShilpaHi Shilpa
Welcome to SCN!
The blog you refered to might be for previous versions of PI. You can refer to the following two wikis to find out what are the relevant JAR files for PI 7.3 and also how to get them.
XI libraries for development - Process Integration - SCN Wiki
Where to get the libraries for XI development - Process Integration - SCN Wiki
It also looks like for newer versions, you might not need to manually get and add those JAR files into your NWDS project - please refer to the first comment on the blog below. I have not tried it personally as I'm not using the latest NWDS, but you can try that first, and if it does not work, then go get them manually.
PI 7.4 - Adapter Module Creation using EJB 3.0
Do note that you should be using the JAR files that is corresponding to your PI server version.
As for your third question, that does not apply to you. XLS is the older non-XML format, and therefore cannot be read by XLST since it is in binary format.
Rgds
Eng Swee -
Transfer excel files from iMac to excel file on ipad
transfer excel files from iMac to excel file on iPad. Using iTunes, I transfered files on my mac using Numbers and it worked fine, but trying the same method for an Excel file didn't work (i.e., the Excel file never showed up on my iPad.)
Thanks for any help you can provide.
LJhttp://www.wondershare.com/pdf/transfer-pdf-to-ipad.html
http://www.bythom.com/pdffaq.htm
How to Transfer PDFs to an iPad
http://www.dummies.com/how-to/content/how-to-transfer-pdfs-to-an-ipad.html
Cheers, Tom -
I saved my Form Central spreadsheet file once as a excel file but Forms Central will not allow me to save the file a second time as an excel file. I am informed that I cannot complete this action because the file me be open in another application, but it is not open in another application. What is the problem, and how do I solve the problem. Thank you. Jeff
First check the version of the document with Jongware's script "Identify.jsx" (ExtendScript/JavaScript).
You can find it here:
[Ann] Identify Your InDesign File
If it is CS 5.5 or above, you need someone to open it in the version the script says and export an IDML representation from that. Another way would be to install a 30days version of CS6 or above (CC) and do it yourself.
In regards of the script showing a result for InDesign files higher than CS6:
CS7 = CC v9
CS8 = CC v10 = CC-2014 or CC2014.1
Uwe -
Read an avi file using "Read from binary file" vi
My question is how to read an avi file using "Read from binary file" vi .
My objective is to create a series of small avi files by using IMAQ AVI write frame with mpeg-4 codec of 2 second long (so 40 frames in each file with 20 fps ) and then send them one by one so as to create a stream of video. The image are grabbed from USB camera. If I read those frames using IMAQ AVI read frame then compression advantage would be lost so I want to read the whole file itself.
I read the avi file using "Read from binary file" with unsigned 8 bit data format and then sent to remote end and save it and then display it, however it didnt work. I later found that if I read an image file using "Read from binary file" with unsigned 8 bit data format and save it in local computer itself , the format would be changed and it would be unrecognizable. Am I doing wrong by reading the file in unsined 8 bit integer format or should I have used any other data types.
I am using Labview 8.5 and Labview vision development module and vision acquisition module 8.5
Your help would be highly appreciated.
Thank you.
Solved!
Go to Solution.
Attachments:
read avi file in other data format.JPG 26 KBHello,
Check out the (full) help message for "write to binary file"
The "prepend array or string size" input defaults to true, so in your example the data written to the file will have array size information added at the beginning and your output file will be (four bytes) longer than your input file. Wire a False constant to "prepend array or string size" to prevent this happening.
Rod.
Message Edited by Rod on 10-14-2008 02:43 PM -
CSV files to a single excel file
Hi All!
I would like to ask regarding the conversion of CSV files into a single Excel file.
I am planning to combine all my 8 csv files into a single excel file being separted by sheets. each csv file will be converted in to a worksheet and be added to the excel workbook file.
Any idea? I've heard about POI but i don't see any documentation for java beginners and simple example program that will convert CSV --> Worksheet and add that worksheet to an excel file.
Thanx,
MaDzhttp://forum.java.sun.com/thread.jspa?threadID=600161&messageID=3207453
-
How to store the data coming from network analyser into a text or excel file
Hii everyone
I'm using Agilent 8719ET network analyser and wish to store the data coming from netowrk analyser into a text file/ excel file.
Presently I'm able to get the data on Labview graph using GPIB . Can anyone suggest how to go ahead after collect data sub vi. How can the data be stored into a file apart from showing on the graph?
Attached is the vi for kind consideration...
Looking for help
Regards
Rohit
Attachments:
Agilent 87XX Series Exceed Max Meas.vi 43 KBFirst let me say that your code really looks pretty good. The data handling could be made more efficient by calculating the number of datapoints that are going to be in the completed dataset and preallocating the entire array -- but depending upon your answer to my questions, the logic in the lower shift register may be going away - so we won't worry about that right now.
The thing I need to know before addressing the data storage question is: Each time you call "Collect and Display Data.vi", how many element are in the array? Are you reading single data points, or a group of data? (BTW: if the answer to that question is obvious based on the way the other VIs are setup, I don't have the drivers so I can't tell what the setup values are.) Second, how fast does the loop iterate? Are we talking msec per loop?, seconds? fortnights?
The issues here are two-fold: how much data? and how fast is it coming? The answer to these will tell you how to save the data.
Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps -
How to get query result in comma dilimited text or excel file?
Does anybody know how to get query results in comma delimited
text file or excel file, I tried spool abc.txt, but the result
showed some ------ lines
ThanksTry doing this in your sql scripts
set heading off
set pagesize 0
set linesize 4000
set feedback off
set verify off
set trimespace on
set colsep ","
spool output.txt
select * from dual (or whatever you are querying
spool off
There may be a couple other set statement that you could add but
this should get you started in the right direction -
Can I use a simple Excel file on my phone and open it on my PC?
I'm a PE teacher who collects fitness data while outside and then tranfers it to an Excel file on my work PC. I usually collect by pencil and paper and type it in later. Is there an app or can I use iCloud to use my iPhone 4 to collect my data and then open it up on Excel?
Just to add to what Winston said, there are a lot of Office-type apps that will do the job better than Numbers in my opinion. Examples are Documents to Go, Quickoffice, Office2HD but there are others.
Numbers is an OK app if you want to use the files created on iOS devices in Numbers on your Mac, but when it comes to MS Office compatibility, it is defficient. The apps I mentioned above all do a reasonable job in terms of Excel compatilibility.
In terms of accessing the files on your PC, use a free service like Dropbox to sync your documents on iOS and PCs. -
Unable to Connect to the Data Source with Report Builder when using a closed Excel file
I am using Report Builder 3.0 and to get started I am using an Excel spreadsheet as my data source. I set this up just fine. I can connect successfully if the file is open Excel. But if I close the file, I get the error "Unable to
Connect to the data source".
This is my connection string:
Dsn=Licenses;dbq=C:\USERS\AMEADE\DOCUMENTS\licenses.xlsx;defaultdir=C:\USERS\AMEADE\DOCUMENTS;driverid=790;fil=excel 8.0;maxbuffersize=2048;pagetimeout=5
Works fine if the file is open but stops working when the file is closed. Any idea what I can do?Hi Alice,
Based on my understanding, when you keep the Excel file open, you can connect to the data source correctly. But when you close the Excel file, the error “Unable to Connect to the data source” is thrown out.
In your scenario, I would like to know if only this Excel comes across this issue. Have you experienced the same issue when you use other Excel files as a data source? As we tested in our environment, we can connect to the data source whether the Excel file
is open. You can refer to this
article to create a data source again then check if you can connect to the data source when the Excel file is closed.
If issue persists, I would suggest you use the
Process Monitor to capture the processes during the connection to the data source. Then check the result of each process to find the exact reason.
If you have any question, please feel free to ask.
Best regards,
Qiuyun Yu
Qiuyun Yu
TechNet Community Support -
Hello,
Can somebody suggest me how to read from an excel file (consisting of 10 work sheets) to an array?
Thanks,
SheYou have to be careful when using the spreadsheet-files vi's. They are located in the Functions Palette under File IO, you will find "Write To / Read From Spreadsheet File.vi"s.
Here is what the Context Help says about the vi function:
"Reads a specified number of lines or rows from a numeric text file beginning at a specified character offset and converts the data to a 2D, single-precision array of numbers. You optionally can transpose the array. The VI opens the file before reading from it and closes it afterwards. You can use this VI to read a spreadsheet file saved in text format. This VI calls the Spreadsheet String to Array function to convert the data. "
This is quick & easy when the spreadsheet is all the same format. You can set the format to string as well. HOWEVER... you do have to convert the Excel spreadsheet to text before using it.
I haven't experimented with the Active-X, but it may look as the way to go if you have combination text / numeric values in the spreadsheet.
If you did convert it to text, then you can use array functions as well and treating the file as an array of strings (see very brief example attached). The example is to illustrate a point only
JLV
Attachments:
starting point for spreadsheet.vi 28 KB
Maybe you are looking for
-
Transfer from Subtotal in one table to another sheet.
Hi, about a year ago i made a salary application for my production company. This works quite well, but when I supposed to report amounts for each employed to the swedish tax authorities I am still not automatic because I haven't solved how to transfe
-
plz solove the problem
-
PO list display - creator of PO field
Hi Gurus , Is there any standard PO report in which i can get the ID/name of the creator of the PO in the report's output ? I have checked ME2n but it does not have 'created by' or 'requisitioner' field in the output . Regards, Saurav
-
How to press key through code in B1
Hi All, How to press key through code in B1 ? Is there any event?
-
Removing stock from the provider
Hello, We have a Stock Material Provider to Vendor. We send material to our provider using tx-MB1B movement 541 (Trfr pstng to stock with subcontractor form unrestr. u2013use st.). When a sales order is confirmed a purchase requisition is created and