How to modify existing data in a file help me!!!!!
hi i had a file which contais the some data like
folder1:50
folder2:30
folder3:56 etc.....
now my problem is i want to update the integer value for a specified folder entry
i.e i want to modify folder1:50 to folder1:80 how to do it?
i am new to java PLZ help
i am unable to find best solution for this
thanks in advance
Well, it makes a big difference if what you're doing is always just replacing some bytes, or if bytes might be inserted or deleted.
In the latter case there really isn't much point in doing anything but generating a new version of the file by copying the unchanged bits and inserting the replacement bits. Then you can rename the old file to a back up and rename the new file to the old file name.
If you're always simply replacing one byte for another (and be careful because, depending on the character encoding, single characters may encode to a different number of bytes), then you can try using RandomAccessFile and, for added flexibility, you can memory map a file using RandomAccessFile.getFileChannel.map();
Either of these techniques will allow you to go to a particular position in the file and overwrite bytes to your heart's content. All your sample records are the same length. If the file is guaranteed to have all it's records the same length then, obviously, it will be easier to find the right bytes. If not you'll have to do a bit of searching.
Similar Messages
-
How to Load the data from excel file(Extension is .CSV) into the temp.table
Hi
How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
Kindly Suggest the Solution.
Regards,
SachinHello Sachin,
You can use the following metalink note:How to Read Data from an EXCEL Spreadsheet into a Form Using Webutil Client_OLE2 (Doc ID 813535.1) and modify it a little bit.
Instead of copy values into forms you can save them in your temporary table.
Kind regards,
Alex
If someone's helpful or correct please mark it accordingly. -
How do you import data base dmp file in oracle 10g
How do you run data base dmp file in oracle 10g
Examples..
Table Exports/Imports
The TABLES parameter is used to specify the tables that are to be exported. The following is an example of the table export and import syntax:
expdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR dumpfile=EMP_DEPT.dmp logfile=expdpEMP_DEPT.log
impdp scott/tiger@db10g tables=EMP,DEPT directory=TEST_DIR dumpfile=EMP_DEPT.dmp logfile=impdpEMP_DEPT.log
For example output files see expdpEMP_DEPT.log and impdpEMP_DEPT.log.
The TABLE_EXISTS_ACTION=APPEND parameter allows data to be imported into existing tables.
Schema Exports/Imports
The OWNER parameter of exp has been replaced by the SCHEMAS parameter which is used to specify the schemas to be exported. The following is an example of the schema export and import syntax:
expdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR dumpfile=SCOTT.dmp logfile=expdpSCOTT.log
impdp scott/tiger@db10g schemas=SCOTT directory=TEST_DIR dumpfile=SCOTT.dmp logfile=impdpSCOTT.log
For example output files see expdpSCOTT.log and impdpSCOTT.log.
Database Exports/Imports
The FULL parameter indicates that a complete database export is required. The following is an example of the full database export and import syntax:
expdp system/password@db10g full=Y directory=TEST_DIR dumpfile=DB10G.dmp logfile=expdpDB10G.log
impdp system/password@db10g full=Y directory=TEST_DIR dumpfile=DB10G.dmp logfile=impdpDB10G.log -
How to read the data from Excel file and Store in XML file using java
Hi All,
I got a problem with Excel file.
My problem is how to read the data from Excel file and Store in XML file using java excel api.
For getting the data from Excel file what are all the steps i need to follow to get the correct result.
Any body can send me the code (with java code ,Excel sheet) to this mail id : [email protected]
Thanks & Regards,
Sreenu,
[email protected],
india,If you want someone to do your work, please have the courtesy to provide payment.
http://www.rentacoder.com -
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 load the data from excel file into temprory table in Forms 11g?
Hi
How to Load the data from excel file(Extension is .CSV) into the temporary table of oracle in Forms11g.
My Forms Version is - Forms [64 Bit] Version 11.1.2.0.0 (Production)
Kindly Suggest the Solution.
Regards,
SachinDeclare
v_full_filename varchar2(500);
v_server_path varchar2(2000);
v_separator VARCHAR2(1);
v_filename VARCHAR2(400);
filename VARCHAR2 (100);
v_stop_load varchar2 (2000);
v_rec_error_log varchar2(4000);
v_error_log varchar2(4000);
ctr NUMBER (12);
cols NUMBER (2);
btn number;
RES BOOLEAN;
application ole2.obj_type;
workbooks ole2.obj_type;
workbook ole2.obj_type;
worksheets ole2.obj_type;
worksheet ole2.obj_type;
cell ole2.obj_type;
cellType ole2.OBJ_TYPE;
args ole2.obj_type;
PROCEDURE olearg
IS
args ole2.obj_type;
BEGIN
args := ole2.create_arglist;
ole2.add_arg (args, ctr);
ole2.add_arg (args, cols);
cell := ole2.get_obj_property (worksheet, 'Cells', args);
ole2.destroy_arglist (args);
END;
BEGIN
v_full_filename := client_get_file_name(directory_name => null
,file_name => null
,file_filter => 'Excel files (*.xls)|*.xls|'
||'Excel files (*.xlsx)|*.xlsx|'
,message => 'Choose Excel file'
,dialog_type => null
,select_file => null
If v_full_filename is not null Then
v_separator := WEBUTIL_CLIENTINFO.Get_file_Separator ;
v_filename := v_separator||v_full_filename ;
:LOAD_FILE_NAME := substr(v_filename,instr(v_filename,v_separator,-1) + 1);
RES := Webutil_File_Transfer.Client_To_AS(v_full_filename,"server_path"||substr(v_filename,instr(v_filename,v_separator,-1) + 1));
--Begin load data from EXCEL
BEGIN
filename := v_server_path||substr(v_filename,instr(v_filename,v_separator,-1) + 1); -- to pick the file
application := ole2.create_obj ('Excel.Application');
ole2.set_property (application, 'Visible', 'false');
workbooks := ole2.get_obj_property (application, 'Workbooks');
args := ole2.create_arglist;
ole2.add_arg (args, filename); -- file path and name
workbook := ole2.get_obj_property(workbooks,'Open',args);
ole2.destroy_arglist (args);
args := ole2.create_arglist;
ole2.add_arg (args, 'Sheet1');
worksheet := ole2.get_obj_property (workbook, 'Worksheets', args);
ole2.destroy_arglist (args);
ctr := 2; --row number
cols := 1; -- column number
go_block('xxx');
FIRST_RECORD;
LOOP
--Column 1 VALUE --------------------------------------------------------------------
olearg;
v_stop_load := ole2.get_char_property (cell, 'Text'); --cell value of the argument
:item1 := v_stop_load;
cols := cols + 1;
--Column 2 VALUE --------------------------------------------------------------------
olearg;
:item2 := ole2.get_char_property (cell, 'Text'); --cell value of the argument
cols := cols + 1;
--<and so on>
ole2.invoke (application, 'Quit');
ole2.RELEASE_OBJ (cell);
ole2.RELEASE_OBJ (worksheet);
ole2.RELEASE_OBJ (worksheets);
ole2.RELEASE_OBJ (workbook);
ole2.RELEASE_OBJ (workbooks);
ole2.RELEASE_OBJ (application);
END;
--End load data from EXCELPlease mark it as answered if you helped. -
How to load the data from excel file into table in oracle using UTL_FI
How to load the data from excel file into table in oracle
and from table to excel file
using UTL_FILE package
Please give me some exampleThis is something i tried in oracle apex
http://avdeo.com/2008/05/21/uploading-excel-sheet-using-oracle-application-express-apex/
Regards,
CKLP -
How to remove existing password in PDF file?
I am using Acrobat 6.0, and would like to know on how to remove existing password in PDF file.
When I try to open the PDF and saveas file using another name, it would not work.
Does anyone have any suggestions?
Thanks in advance for any suggestionsFile > Properties. Then under Security change Security method to None; enter the Control password when prompted. Then Save As.
-
How can i read data in pagemaker file (PMD) using Visual Studio C# NET ?
I have bunch of data in .PMD file (Page Maker Document). Which contains mathematical equations and chemistry formulas, I am a .NET developer, and I am writing code for one of the educational learning system. For that I need to read and store mathematical equations/ chemistry formulas from .PMD file into database then display on the browser page.
Is it possible to read data from .PMD file using C#.NET, do I need to use any external libraries. How can I import .PMD to MATHML (Mathematical Markup language)?
Any existing examples for C#.NET?
Please help me regarding this.I can't claim to know much about visual C# Net, but I do know a bit about pagemaker. It really can't handle equations. there are a few work arounds involving things like baseline shifts and multiple text boxes, but generally equations were created in different programs and placed in pagemaker in picture or eps files. Either way the chances of extracting usable data out of pagemaker is very slim.
Jay -
How to find creation date of a file in RHEL 5
We have instances having RHEL 5.10 in our setup. The file system type shown using
df –T
says that file system type is ext3. The ls –ltr command seems to show the modification time but not created date.
I hope my question is clear on how to find the created date of a file in Red Hat Linux.
Requesting a reply to my query.
RegardsHi,
I agree with Dude.
Also you can check the command find, this command has many options like:
-atime n
File was last accessed n*24 hours ago.
-cmin n
File’s status was last changed n minutes ago.
-ctime n
File’s status was last changed n*24 hours ago. See the comments for -atime to understand how
rounding affects the interpretation of file status change times.
-mtime n
File’s data was last modified n*24 hours ago. See the comments for -atime to understand how
rounding affects the interpretation of file modification times.¨
Best regards -
How to modify hierarchical data with JavaAPI?
Hi
we have a hierarchical structure for "Categories" of products. Its a simple Table of type "Hierarchy".
Now I need to add new entries to the Tree, or move existing entries to some different parents. But I can neither find a command like ModifyHierarchyTree nor is there a method to set the parent record on a HierNode instance.
How can I set the parent node of a hierarchy node with JavaAPI 2?
(Patch level is 5.5.42.65)
Thanks in advance!Hi Roger,
I think you can modify the Data Groups hierarchy directly from within the Add Objects dialog, by clicking the Edit button to open the Edit Data Groups dialog and then using the context menu as in any editable tree to add siblings and children, and to delete and rename existing nodes
You can also edit the Data Groups hierarchy by choosing Objects ® Edit Data Groups from the main menu.
Whereas other trees allow non-unique node names as long as sibling nodes do not have the same name, data group names must be unique across the entire Data Groupshierarchy.
Hope it helped.
Regards,
Krutarth -
How to delete all data in a file
Hello.
I am trying to clear all the data from a file that will be continually replaced with a file of the same name with new data in it. The goal is to delete the file while going through a while loop. The problem I am having is with a dialog box popping up asking me if I want to replace the existing data. I don't want a dialog box to pop up, just for the loop to continuosly delete any information (or to write a null string into the file) while it is looping, even if the file is empty. At some point, the file will be replaced by actually data, which will cause a case structure to react and trigger the program to begin.
Attached is the file.
Thanks for the help!
Tyler
Attachments:
Tyler.zip 658 KBHello Tyler,
now I had a look into your vi and made some comments on it.
If your vi contains only LV functions you don't need to save as llb with all subVI from lv.lib!
Best regards,
GerdW
CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
Kudos are welcome
Attachments:
NewMethod.vi 90 KB -
How can I query data from XML file stored as a CLOB ?
Hi folks,
please see below sample of XML file, which is stored in "os_import_docs", column "document" as CLOB.
I would like to query this XML file using some SQL select.
How can I query data form below XML?
<?xml version="1.0" encoding="UTF-8"?>
<etd>
<header>
<AR>000000000</AR>
<AW>0</AW>
<CT>S</CT>
<CU>H</CU>
<CZ>SS48</CZ>
<BU>4</BU>
<CH>0032</CH>
<CK>2012-11-01</CK>
<CL>21:18</CL>
<CW>225</CW>
<CX>0</CX>
<CF>SS-CZL18</CF>
<DV>2</DV>
</header>
<account_group id="234">
<account id="234">
<invoice id="000742024">
<da>
<AR>000742024</AR>
<AW>0</AW>
<CT>D</CT>
<CU>A</CU>
<CH>0032</CH>
<BY>31-10-2012</BY>
<CA>25-10-2012</CA>
<AB>234</AB>
<AA>234</AA>
<BS>88754515</BS>
<AD>Mike Tyson</AD>
<AC>Mike Tyson</AC>
<AZ>CZ6521232465</AZ>
<AE/>
<CG>A</CG>
<AL>A</AL>
<BZ>.</BZ>
<AH>Some street</AH>
<AI/>
<AF>Some city</AF>
<AK>Kraj</AK>
<AG>CZ</AG>
<AJ>885 21</AJ>
<CR>21-11-2012</CR>
<AY>602718709</AY>
<AV>800184965</AV>
<AP/>
<AO/>
<AQ/>
<AN/>
</da>
<da>
<AR>000742024</AR>
<AW>0</AW>
<CT>D</CT>
<CU>A</CU>
<CH>0032</CH>
<BY>31-10-2012</BY>
<CA>25-10-2012</CA>
<AB>234</AB>
<AA>234</AA>
<BS>88754515</BS>
<AD>Mike Tyson</AD>
<AC>Mike Tyson</AC>
<AZ>CZ6521232465</AZ>
<AE/>
<CG>A</CG>
<AL>L</AL>
<BZ>Mike Tyson</BZ>
<AH>Some street</AH>
<AI/>
<AF>Some city</AF>
<AK>Kraj</AK>
<AG>CZ</AG>
<AJ>885 21</AJ>
<CR>21-11-2012</CR>
<AY/>
<AV>800184965</AV>
<AP/>
<AO/>
<AQ/>
<AN/>
</da>
<detaildc CH="0032" AB="234" BS="11888954" BB="32" BA="CZ" AT="" CI="7077329000002340342" AU="" DU="1Z48395" CB="CZK">
<dc>
<AW>0</AW>
<CT>D</CT>
<CU>C</CU>
<BY>31-10-2012</BY>
<CA>25-10-2012</CA>
<CV>8151</CV>
<BT>12111</BT>
<CJ>1</CJ>
<AM>0</AM>
<DR>PC</DR>
<DS/>
<DO>25-10-2012</DO>
<DQ>18:42</DQ>
<CE>1</CE>
<BH>8151</BH>
<CY>8151 SHELL MALKOVICE P</CY>
<DP>049336</DP>
<DT/>
<BQ/>
<BR>500000</BR>
<CN>30</CN>
<CM>030</CM>
<BO>160,00</BO>
<BF>38,900</BF>
<BC>6224,00</BC>
<BI>32,417</BI>
<CD>B</CD>
<BG>0,600</BG>
<BK>31,817</BK>
<BJ>0,000</BJ>
<DI>8</DI>
<BP>20,00%</BP>
<CC>CZK</CC>
<BM>5090,67</BM>
<BN>1018,13</BN>
<BL>6108,80</BL>
<BD>5090,67</BD>
<BE>1018,13</BE>
<DW>6108,80</DW>
<CO>Nafta</CO>
</dc>
</detaildc>
<dt>
<AR>000742024</AR>
<AW>0</AW>
<CT>D</CT>
<CU>T</CU>
<CH>0032</CH>
<BY>31-10-2012</BY>
<CA>25-10-2012</CA>
<AB>234</AB>
<AA>234</AA>
<BS>11888954</BS>
<BB/>
<BA>CZ</BA>
<DG>1</DG>
<CN>30</CN>
<CM>030</CM>
<DF>160,00</DF>
<DH>litr</DH>
<DJ>20,00%</DJ>
<DD>5090,67</DD>
<DE>1018,13</DE>
<DC>6108,80</DC>
<DB>CZK</DB>
<DA>P</DA>
<AX/>
<CQ/>
<CP/>
</dt>
<dt>
<AR>000742024</AR>
<AW>0</AW>
<CT>D</CT>
<CU>T</CU>
<CH>0032</CH>
<BY>31-10-2012</BY>
<CA>25-10-2012</CA>
<AB>234</AB>
<AA>234</AA>
<BS>11888954</BS>
<BB/>
<BA>CZ</BA>
<DG>2</DG>
<CN/>
<CM/>
<DF>160,00</DF>
<DH>litr</DH>
<DJ/>
<DD>5090,67</DD>
<DE>1018,13</DE>
<DC>6108,80</DC>
<DB>CZK</DB>
<DA/>
<AX/>
<CQ/>
<CP/>
</dt>
<dt>
<AR>000742024</AR>
<AW>0</AW>
<CT>D</CT>
<CU>T</CU>
<CH>0032</CH>
<BY>31-10-2012</BY>
<CA>25-10-2012</CA>
<AB>234</AB>
<AA>234</AA>
<BS>11888954</BS>
<BB/>
<BA>CZ</BA>
<DG>19</DG>
<CN/>
<CM/>
<DF/>
<DH/>
<DJ/>
<DD>5090,67</DD>
<DE>1018,13</DE>
<DC>6108,80</DC>
<DB>CZK</DB>
<DA/>
<AX/>
<CQ/>
<CP/>
</dt>
<dt>
<AR>000742024</AR>
<AW>0</AW>
<CT>D</CT>
<CU>T</CU>
<CH>0032</CH>
<BY>31-10-2012</BY>
<CA>25-10-2012</CA>
<AB>234</AB>
<AA>234</AA>
<BS>11888954</BS>
<BB/>
<BA>CZ</BA>
<DG>8</DG>
<CN/>
<CM/>
<DF/>
<DH/>
<DJ/>
<DD>5090,67</DD>
<DE>1018,13</DE>
<DC>6108,80</DC>
<DB>CZK</DB>
<DA/>
<AX/>
<CQ/>
<CP/>
</dt>
</invoice>
</account>
</account_group>
<footer>
<AR>999999999</AR>
<AW>0</AW>
<CT>S</CT>
<CU>T</CU>
<CZ>SS48</CZ>
<BU>4</BU>
<CH>0032</CH>
<CK>2012-11-01</CK>
<CL>23:04</CL>
<CW>225</CW>
<BX>1</BX>
<CS>7</CS>
<BW>0000000000000610880</BW>
</footer>
</etd>sample - not working:
select x.*
from os_import_docs d
,XMLTABLE('/etd/header'
PASSING httpuritype(d.document).getXML()
COLUMNS
response_status varchar2(50) PATH 'AR'
) x
where d.object_id = 2587058
and rownum = 1;
ORA-22835: Buffer too small for CLOB to CHAR or BLOB to RAW conversion (actual: 6196, maximum: 4000)Many thanks,
TomasHello,
many thanks for the reply. Your examples are very usefull for me.
To answer your questions.
An XML structure:
/etd
/header - repeat in each row in output
/account_group/account
/invoice
/da - repeat for each details under "selected "invoice
/detaildc/dc - the lowest level
/detaildn/dn - the lowest level
/dt - repeat for each details under "selected "invoice
/footer - repeat in each row in outputI would like to to have a 1 row for each "record" in /detaildc section and include related nodes at higher levels.
Please see below XML file, which is simplified file of example in first post, but includes a complete xml structure which needs to be queried in db.
<?xml version="1.0" encoding="UTF-8"?>
<etd>
<header>
<AR>000000000</AR>
<CK>2012-10-31</CK>
<CF>SS-CZL19</CF>
</header>
<account_group id="234">
<account id="234">
<invoice id="EI08P4000">
<da>
<AR>EI08P4000</AR>
<AD>Mickey Mouse</AD>
</da>
<detaildc DU="1Z56655" CB="EUR">
<dc>
<DO>16-10-2012</DO>
<CY>ASFINAG POST_MAUT</CY>
<BM>1940,60</BM>
<CO>Dalnicni znamka</CO>
</dc>
</detaildc>
<detaildc DU="2Z55050" CB="EUR">
<dc>
<DO>17-10-2012</DO>
<CY>ASFINAG POST_MAUT</CY>
<BM>1328,10</BM>
<CO>Dalnicni znamka</CO>
</dc>
</detaildc>
<detaildc DU="2Z90001" CB="EUR">
<dc>
<DO>27-10-2012</DO>
<CY>ASFINAG POST_MAUT</CY>
<BM>185,10</BM>
<CO>Poplatek</CO>
</dc>
</detaildc>
<dt>
<AR>EI08P4000</AR>
<DG>8</DG>
</dt>
</invoice>
</account>
<account id="234">
<invoice id="EI13T7777">
<da>
<AR>EI13T7777</AR>
<AD>Mickey Mouse</AD>
</da>
<detaildc DU="1Z48302" CB="EUR">
<dc>
<DO>26-10-2012</DO>
<CY>SANEF 07706 A 07704</CY>
<BM>232,10</BM>
<CO>Dalnicni poplatek</CO>
</dc>
</detaildc>
<detaildc DU="1Z48302" CB="EUR">
<dc>
<DO>20-10-2012</DO>
<CY>TEST A 07704</CY>
<BM>30,10</BM>
<CO>Poplatek</CO>
</dc>
</detaildc>
<dt>
<AR>EI13T7777</AR>
<DG>8</DG>
</dt>
</invoice>
</account>
<account id="234">
<invoice id="EI327744">
<da>
<AR>EI327744</AR>
<AD>Mickey Mouse</AD>
</da>
<detaildn CI="707732 00000234" >
<dn>
<BY>30-10-2012</BY>
<BM>8,10</BM>
</dn>
</detaildn>
<detaildn CI="707732 00000234" >
<dn>
<BY>30-10-2012</BY>
<BM>399,50</BM>
</dn>
</detaildn>
<dt>
<AR>EI327744</AR>
</dt>
</invoice>
</account>
<account id="234">
<invoice id="EI349515">
<da>
<AR>EI349515</AR>
<AD>Mickey Mouse</AD>
</da>
<detaildc DU="1Z56514" CB="EUR">
<dc>
<DO>29-10-2012</DO>
<CY>ALLAMI AUTOPALYAKEZE</CY>
<BM>1240,60</BM>
<CO>Dalnicni znamka</CO>
</dc>
</detaildc>
<detaildc DU="1Z56515" CB="EUR">
<dc>
<DO>19-10-2012</DO>
<CY>ASFINAG POST_MAUT</CY>
<BM>7428,10</BM>
<CO>Dalnicni znamka</CO>
</dc>
</detaildc>
<detaildc DU="1Z56515" CB="EUR">
<dc>
<DO>12-10-2012</DO>
<CY>UK</CY>
<BM>954,10</BM>
<CO>Poplatek</CO>
</dc>
</detaildc>
<dt>
<AR>EI349515</AR>
<DG>8</DG>
</dt>
</invoice>
</account>
</account_group>
<footer>
<CZ>SS47</CZ>
<BU>4</BU>
<CH>0032</CH>
<CK>2012-10-31</CK>
<CL>01:25</CL>
</footer>
</etd>Expected output
AR CK CF AR4 AD DU CB DO CY BM CO AR5 DG CI BY BM6 CZ BU CH CK7 CL
0 41213 SS-CZL19 EI08P4000 Mickey Mouse 1Z56655 EUR 16-10-2012 ASFINAG POST_MAUT 1940,60 Dalnicni znamka EI08P4000 8 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI08P4000 Mickey Mouse 2Z55050 EUR 17-10-2012 ASFINAG POST_MAUT 1328,10 Dalnicni znamka EI08P4000 8 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI08P4000 Mickey Mouse 2Z90001 EUR 27-10-2012 ASFINAG POST_MAUT 185,10 Poplatek EI08P4000 8 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI13T7777 Mickey Mouse 1Z48302 EUR 26-10-2012 SANEF 07706 A 07704 232,10 Dalnicni poplatek EI13T7777 8 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI13T7777 Mickey Mouse 1Z48302 EUR 20-10-2012 TEST A 07704 30,10 Poplatek EI13T7777 8 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI327744 Mickey Mouse EI327744 707732 00000234 30-10-2012 8,10 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI327744 Mickey Mouse EI327744 707732 00000234 30-10-2012 399,50 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI349515 Mickey Mouse 1Z56514 EUR 29-10-2012 ALLAMI AUTOPALYAKEZE 1240,60 Dalnicni znamka EI349515 8 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI349515 Mickey Mouse 1Z56515 EUR 19-10-2012 ASFINAG POST_MAUT 7428,10 Dalnicni znamka EI349515 8 SS47 4 32 41213 01:25
0 41213 SS-CZL19 EI349515 Mickey Mouse 1Z56515 EUR 12-10-2012 UK 954,10 Poplatek EI349515 8 SS47 4 32 41213 01:25 -
How to read the data from a file in another computer with user name and password login
How to read read the data from a file in anohter computer which need to login with user name and password?
duplicate post: http://forums.ni.com/t5/LabVIEW/log-on-the-other-computer-with-user-name-and-password/m-p/2061478
duplicate post: http://forums.ni.com/t5/LabVIEW/do-need-to-enter-the-user-name-and-password-when-TCP-ip/m-p/2061612
duplicate post http://forums.ni.com/t5/LabVIEW/log-on-the-other-computer-with-user-name-and-password/m-p/2060682 -
How to store the data of a file into an ArrayList?
Hi! everyone.
I want to know
if I have a File, and the data in the file are type int, type String...
And I have a ArrayList which is of type Question
How do I store the data of that file into the ArrayList
I tried to use the while loop(use the hasNextLine() to read the data line by line)
But I cannot add data which are not of type Question to the ArrayList.
Can you tell me what I should do, please?
I also wonder that
The data of the file are of many types, but when I try to read it with the nextLine(), the data all turn out to be of type String. Why?
Thank you.
Edited by: Terry001 on Apr 30, 2008 1:13 PMNo, a line in the file is just part of a question
The format of the file is like this:
*<question type code> : String*
*<question point value> : int*
*<question category> : String*
*<question difficulty level> : int*
*<question text> : String*
*<question correct answer> : String*
*<optional question-specific data> : String*
*<question terminator> : String*
And here is an example
TF //TrueFalseQuestion
5 //points value
None //category
3 //difficulty level
The capital of the United States is Washington, D.C. //question text
True // answer
*** //quetion terminator
I created an ArrayList in the Test class:
private ArrayList<Question> questions; // Create inside constructor
public Test (String name, String instr)
testName = name;
scoreEarned = 0;
scorePossible = 0;
instructions = instr;
questions = new ArrayList<Question>(); //[MAX_NUMBER_OF_QUESTIONS];
}And I tried to use the following method to store the data of the file to the ArrayList
// This method loads a set of questions from a plain text file
public void loadQuestionsFromFile(String fileName) throws FileNotFoundException
try
File fileReader = new File("input.txt");
Scanner sc = new Scanner(fileReader);
while (sc.hasNextLine())
// I don't know how to pass the data I got from the nextLine() method to the ArrayList because they are of different type
catch (FileNotFoundException a)
System.out.println(a);
} As all you said, I should create an Question object in the while loop
Question temp = new Question ();But I have no idea how to pass the int and String to the Question object.
Thank you
Maybe you are looking for
-
The installation goes on fine, until it begins the "unscheduling apple software update" proccess, at which point I get a message saying; "There is a problem with this Windows Installer package. A program required for this install to complete could n
-
Incredible slowness with LaCie 250 usb drive when trying to delete files
I connected a LaCie d2 250 gigabyte drive to the usb port of the new Airport Extreme. When I try to delete a folder containing a a fairly large amount of data (40,000 files) it took approximately 30 minutes to tally the number of files and then anoth
-
Can I flip pages vertical to horizontal in the same document?
Hi Guys, Just wanted to know if this was possible... to have several pages in the same document but some in vertical format (8.5 x 11") and others in wide format (11 x 8.5")? Please let me know. Thanks
-
I just attached a new external drive to my iMac. I set it up to replace a drive I was using for backup. I cleared off the old drive and want to use it to store/backup my photos. It shows up as a yellow icon on my desktop and the other is green wit
-
Down payment process for Poland - correction invoice
Hi, In note 1007635 is a statement: "Apply code changes given in this note to include ZXVVFU08 (being part of EXIT_SAPLV60B_008), save and activate the project." Does anyone know where I can find this code?