With webutil-client_host, send txt file to client printer
hi,
I wanna to learn how to send a txt file to client default printer(local or network),
I created txt file at client disk, and try to send printer directly,
just try some statement looks like below;
a.client_host('cmd /c start print C:\TEMP399899.txt /d:lpt1');
b.client_host('cmd /c start copy C:\TEMP399899.txt lpt1');
I do not know the command prompt syntax, please help me, reference me,
thanks
Hi,
on a command line type
print /?
for the help of how to print documents. On XP this help is
PRINT [D:device] [[drive:][path]filename[...]]
/D:device Specifies a print device.
Frank
Similar Messages
-
Send a txt file to the printer with java
Hello,
I want to sent a txt file to the printer in java. I' am using the USB port. I can try to setup a dos command (print c:\test.txt), but I don't know the exactly command.
There is also another solution in java I thing but I don't know the code!
Can somebody give me the exact command for DOS and/or the code I have to write in java?
THANX!!!!in dos imo you are not able to use usb-port. if your printer would be on lpt you could use javacomm ( http://java.sun.com/products/javacomm/index.html ). there is also another thread talking about this (print text to lpt). for your usb-problem i don't have a solution. but you could use JNI (java native interface). write code in c, compile to dll and use it in java.
tobias
ps: the other thread ( http://forum.java.sun.com/thread.jsp?forum=31&thread=224460 ) -
rying to get Photoshop CS4 functional with Mavericks and an Epson 3880 printer. CS4 fails to send a file to the print queue. Have reinstalled the Epson 3880 driver for Mavericks. All looks good but no file is sent.
Does anyone know how to fix this?What EXACT version of Photoshop CS4 are you running? You should be on Photoshop CS4 v 11.0.2.
Also run Apple's software update to see whether it offers you the latest Epson update:
Printer Driver v9.33
Epson Stylus Pro 3880, Drivers & Downloads - Technical Support - Epson America, Inc.
MOST IMPORTANTLY: have Photoshop re-create its own Preferences:
To re-create the preferences files for Photoshop, start the application while holding down Ctrl+Alt+Shift (Windows) or Command+Option+Shift (Mac OS). Then, click Yes to the message, "Delete the Adobe Photoshop Settings file?"
Note: If this process doesn't work for you while you're using a wireless (Bluetooth) keyboard, attach a wired keyboard and retry.
Important: If you re-create the preferences by manually deleting the Adobe Photoshop CS6 Settings file, make sure that you only delete that file. If you delete the entire settings folder, you also delete any unsaved actions or presets.
Reinstalling Photoshop does not remove the preferences file. Before reinstalling Photoshop, re-create your preferences.
NEW Video! Julieanne Kost created a video that takes you through two ways of resetting your Photoshop preferences. The manual preference file removal method is between 0:00 - 5:05. The keyboard shortcut method is between 5:05 - 8:18. The video is located here:
How to Reset Photoshop CS6’s Preferences File | The Complete Picture with Julieanne Kost | Adobe TV
Mac OS
Important: Apple made the user library folder hidden by default with the release of Mac OS X 10.7. If you require access to files in the hidden library folder to perform Adobe-related troubleshooting, see How to access hidden user library files. -
Need existing custom script to run with a .csv or .txt file
Hi, Scripting Guys!
I am a very novice novice when it comes to PowerShell -- I'll state that up front. So apologies if the answer to this is really basic. I am trying to use a script written by someone else, where I can simply paste in the script, identify the user by any one
of several attributes, and the magic happens (in this case, all mail attributes in the AD Object are cleared and then the email address is added back in, resetting that object to the point where IDSync can run). For a single user at a time, it works
perfectly.
.\Reset-MailAccountforIDSync.ps1 -Identity "[email protected]"
My problem is that I have a .csv file with 60 users I need to run this script on, and there's a possibility of other large batches in the future. How can I convert this single user script into one that can work with a .csv or .txt file?
Thanks, Stormicat/J.L.NewmarkThis will do the trick.
$csv=Import-Csv users.csv
foreach($user in $csv){
.\Reset-MailAccountforIDSync.ps1 -Identity $user.Mail
Of course you will have to learn enough to understand that so start here:
http://technet.microsoft.com/en-us/scriptcenter/dd793612.aspx
¯\_(ツ)_/¯ -
How to send txt file as attachement in email
Hi Experts ,
How to send txt file as attachement in email .
which function module i useHi,
Try to use this one
CALL FUNCTION 'SO_NEW_DOCUMENT_SEND_API1'
Hope it can solve your problem!
Good luck!
Tao -
Use proxy to send TXT file (FTP)
Hi experts!
I know it's possible to send a xml message by FTP using a proxy (called in an ABAP program). This is very easy.
I also know that it's possible to send TXT files cyclicly (every hour, for example) for FTP, using XI (or PI) as a FTP server.
What i don't know is that if it's possible to use a proxy, in an ABAP program, to send non xml files by FTP.
Is it? How can i do it?
Thanks in advance.
Best regards.
Valter Oliveira.Hi again,
No, the idea is to use XI to send the csv file as an assyn message but i think this is not possible. Proxies always uses xml parser right?
If I can't do this, I can always schedulle a FTP sender channel to go to the directory and send it, but the idea was to use a proxy to do ti.
You mentioned "if you will be using XI, then you can not escape from converting it into XML and then FCC to convert it into csv."
How can i do this? Can i create a xml structure in the sender channel and convert it to csv in the receiver?
Best regards.
Valter Oliveira. -
how to get all how to get all paragraphs style and their fonts of a indesign file and write all info with para info into txt file with scriptingstyle and their fonts of a indesign file and write all info with para info into txt file with scripting
I write the script this one works
var par=doc.stories.everyItem().paragraphs.everyItem().getElements();
for(var i=par.length-1;i>=0;i--)
var font=par[i].appliedParagraphStyle.name;
var font1=par[i].appliedFont.name;
var size=par[i].pointSize;
WriteToFile (par[i].contents + "\r" + "Style : " + font + "\r" + "FONT1 : " + font1 + "\r" + "Size : " + size + "\r", reportFilePath);
function WriteToFile(text, reportFilePath) {
file = new File(reportFilePath);
file.encoding = "UTF-8";
if (file.exists) {
file.open("e");
file.seek(0, 2);
else {
file.open("w");
file.writeln(text);
file.close();
Thanks for all your support -
To send TXT file as an attachment through Email
Hi Experts,
I am working on requirement where i have to send a txt file as an attachment.
Could any one suggest me a solution.
Thanks and Regards,
Jeswanth KadaliHi,
Use the function module SO_NEW_DOCUMENT_ATT_SEND_API1.
We find it convenient to use a custom function module as a wrapper for that.
Here's the code.
FUNCTION Z_EMAILS_ATTACH.
""Local interface:
*" IMPORTING
*" VALUE(EMAIL_SUBJECT) LIKE SODOCCHGI1-OBJ_DESCR
*" VALUE(ATTACHMENT_SUBJECT) LIKE SOPCKLSTI1-OBJ_DESCR OPTIONAL
*" VALUE(ATTACHMENT_DOC_TYPE) TYPE SO_OBJ_TP OPTIONAL
*" REFERENCE(ATTACHMENT_HEADER) LIKE SOLISTI1 STRUCTURE SOLISTI1
*" TABLES
*" EMAIL_BODY STRUCTURE SOLISTI1
*" EMAIL_ATTACHMENT STRUCTURE SOLISTI1 OPTIONAL
*" RECEIVERS STRUCTURE SOMLRECI1
*" EXCEPTIONS
*" UNKNOWN_COMMUNICATION_TYPE
*" ERROR_SENDING_MAIL
*" EMPTY_ATTACHMENT
*" NO_ATTACHMENT_SUBJECT
*" USER_HAS_NO_EMAIL_ADDRESS
*" NO_RECEIVERS
NOTE
Single-testing when the tables passed to the function have reference
structure SOLISTI1 meets with a problem.
Entering non-blank rows into these tables is impossible, it seems.
This is believed to be because the single testing fails to cope with
the width of SOLISTI1-LINE [255 char].
For single testing, use CVDTLINE as the reference structure - it's
only 132 char. Then remember to change it back to SOLISTI1...
Based on Z_EMAIL_ATTACH which sends just one mail.
08.06.2007 JNM
DATA: document LIKE sodocchgi1.
DATA: packlist LIKE sopcklsti1 OCCURS 0 WITH HEADER LINE.
DATA: contents LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA: header LIKE solisti1 OCCURS 0 WITH HEADER LINE.
DATA: RECVLIST LIKE SOMLRECI1 OCCURS 0 WITH HEADER LINE.
DATA: NEXT_ROW LIKE SY-TABIX.
DATA: lines LIKE sy-tabix.
DATA: LAST_LINE_LENGTH TYPE I.
DATA: d_doc_size LIKE packlist-doc_size.
data: email_address type ad_smtpadr.
A user without an email address cannot email.
CALL FUNCTION 'Z_USER_EMAIL_ADDRESS'
EXPORTING
USER_NAME = SY-UNAME
IMPORTING
EMAIL_ADDRESS = email_address
EXCEPTIONS
UNKNOWN_USER = 1
NO_ADDRESS_KEY = 2
NO_ADDRESS_DATA = 3
NO_EMAIL_ADDRESS = 4
OTHERS = 5.
IF SY-SUBRC <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4
raising USER_HAS_NO_EMAIL_ADDRESS.
ENDIF.
Receivers?
describe table receivers lines lines.
if lines eq 0.
raise no_receivers.
endif.
initialization
CLEAR: CONTENTS, DOCUMENT, HEADER, PACKLIST, RECVLIST.
REFRESH: CONTENTS, HEADER, PACKLIST, RECVLIST.
attachment?
DESCRIBE TABLE EMAIL_ATTACHMENT LINES LINES.
IF LINES EQ 0 AND ATTACHMENT_SUBJECT CN SPACE.
RAISE EMPTY_ATTACHMENT.
ENDIF.
IF LINES NE 0 AND ATTACHMENT_SUBJECT CO SPACE.
RAISE NO_ATTACHMENT_SUBJECT.
ENDIF.
email body
concatenate 'SAP client:'
sy-host sy-sysid sy-mandt
into contents separated by space.
append contents.
clear contents.
append contents.
APPEND LINES OF EMAIL_BODY TO CONTENTS.
header - row for body
HEADER = 'BODY HEADER'.
APPEND HEADER.
packing list - row for body
PACKLIST-TRANSF_BIN = SPACE.
PACKLIST-HEAD_START = 1.
PACKLIST-HEAD_NUM = 1.
PACKLIST-BODY_START = 1.
DESCRIBE TABLE CONTENTS LINES PACKLIST-BODY_NUM.
NEXT_ROW = 1 + PACKLIST-BODY_NUM.
*packlist-doc_type = 'EXT'.
PACKLIST-DOC_TYPE = 'RAW'.
APPEND PACKLIST.
IF ATTACHMENT_SUBJECT CN SPACE. " if there's an attachment
attachment into contents
APPEND LINES OF EMAIL_ATTACHMENT TO CONTENTS.
DESCRIBE TABLE EMAIL_ATTACHMENT LINES LINES.
READ TABLE EMAIL_ATTACHMENT INDEX LINES.
LAST_LINE_LENGTH = STRLEN( EMAIL_ATTACHMENT ).
header - attachment
if attachment_header is initial.
HEADER = 'ATTACH'.
else.
header = attachment_header.
endif.
APPEND HEADER.
packing list - row for attachment
CLEAR PACKLIST.
case attachment_doc_type.
when 'XLS'.
PACKLIST-TRANSF_BIN = 'X'.
when others.
PACKLIST-TRANSF_BIN = SPACE.
endcase.
PACKLIST-HEAD_START = 2.
PACKLIST-HEAD_NUM = 1.
PACKLIST-BODY_START = NEXT_ROW.
if not attachment_doc_type is initial.
packlist-doc_type = attachment_doc_type.
else.
PACKLIST-DOC_TYPE = 'RAW'.
endif.
packlist-doc_type = 'EXT'.
PACKLIST-OBJ_DESCR = ATTACHMENT_SUBJECT.
PACKLIST-OBJ_NAME = 'ATTACHMENT'.
PACKLIST-BODY_NUM = LINES.
D_DOC_SIZE = LAST_LINE_LENGTH + ( 255 * ( LINES - 1 ) ).
PACKLIST-DOC_SIZE = D_DOC_SIZE.
APPEND PACKLIST.
ENDIF. "attachment
document
document-obj_name = 'EMAIL'.
DOCUMENT-OBJ_DESCR = EMAIL_SUBJECT.
document-obj_langu = sy-langu.
document-obj_expdat = sy-datum.
document-sensitivty = 'F'.
document-obj_prio = 9.
document-no_change = 'X'.
document-priority = 9.
document-expiry_dat = sy-datum.
ADD 1 TO: DOCUMENT-OBJ_EXPDAT, DOCUMENT-EXPIRY_DAT.
DESCRIBE TABLE contents LINES lines.
D_DOC_SIZE = LAST_LINE_LENGTH + ( 255 * ( LINES - 1 ) ).
document-doc_size = d_doc_size.
call the mail function
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = document
put_in_outbox = 'X'
commit_work = 'X'
TABLES
object_header = header
packing_list = packlist
contents_txt = contents
receivers = receivers
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8.
IF SY-SUBRC > 0.
RAISE ERROR_SENDING_MAIL.
ENDIF.
ENDFUNCTION.
Also remember that the SAP user sending the email must have an email address in the user details, so that SAP has something to put in the "From" field when creating the email.
That's why we use this:
FUNCTION Z_USER_EMAIL_ADDRESS.
""Local interface:
*" IMPORTING
*" REFERENCE(USER_NAME) TYPE SYUNAME DEFAULT SY-UNAME
*" EXPORTING
*" REFERENCE(EMAIL_ADDRESS) TYPE AD_SMTPADR
*" EXCEPTIONS
*" UNKNOWN_USER
*" NO_ADDRESS_KEY
*" NO_ADDRESS_DATA
*" NO_EMAIL_ADDRESS
tables:
adr6,
usr21,
usr02.
SAP logon data
select single *
from usr02
where bname = user_name.
if sy-subrc ne 0.
message i017(ZREP) with
'SAP user' user_name 'is unknown'
raising unknown_user.
endif.
SAP user address key
select single *
from usr21
where bname = user_name.
if sy-subrc ne 0.
message i017(ZREP) with
'No address data assigned to SAP user' user_name
raising no_address_key.
endif.
SAP user address
select single *
from adr6
where addrnumber = usr21-addrnumber and
persnumber = usr21-persnumber.
if sy-subrc ne 0.
message i017(ZREP) with
'No address data found for SAP user' user_name
raising no_address_data.
endif.
email_address = adr6-smtp_addr.
if email_address is initial.
message i017(ZREP) with
'No address data found for SAP user' user_name
raising no_email_address.
endif.
ENDFUNCTION.
John -
Sending TXT files via FM SO_NEW_DOCUMENT_ATT_SEND_API1
Hi developers, I have the following question...
What should I do to attach a text file to an e-mail I send using the FM "SO_NEW_DOCUMENT_ATT_SEND_API1"?
I succed at sending out the mail editing its body and its object, but I still can't attach a TXT file from my 'C:\' directory.
Coul you help me please?
Thanx to everybody.*& Report Z_TEST_MAIL *
REPORT Z_TEST_MAIL .
DATA: P_APP_ID(3) VALUE 'SPY',
P_AP_NUM(2) TYPE N VALUE '03',
P_TITLE(50),
EM_BODY LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE.
DATA: BEGIN OF EM_ATTACH OCCURS 10,
ZZIPFROM(10),
ZZIPTO(5),
GAPFROM(12),
GAPTO(12),
END OF EM_ATTACH.
*_ Start of E-mail content.
EM_BODY = 'Dear User,'.
APPEND EM_BODY.
EM_BODY = ' '.
APPEND EM_BODY.
EM_BODY = 'Please find in the attachment the Zip code Ranges that'.
CONCATENATE EM_BODY ' are missing' INTO EM_BODY.
APPEND EM_BODY.
EM_BODY = 'Please correct the same to ensure that all the Zip codes'.
CONCATENATE EM_BODY ' are maintained' INTO EM_BODY.
APPEND EM_BODY.
EM_BODY = 'In case of any clarifications please contact IT support.'.
APPEND EM_BODY.
EM_BODY = ' '.
APPEND EM_BODY.
EM_BODY = 'Thanks,'.
APPEND EM_BODY.
EM_BODY = ' '.
APPEND EM_BODY.
EM_BODY = 'IT Support.'.
APPEND EM_BODY.
P_TITLE = 'Missing Zip Code ranges'.
EM_ATTACH-ZZIPFROM = 'chandra'.
EM_ATTACH-ZZIPTO = 'Test1'.
EM_ATTACH-GAPFROM = 'Test2'.
EM_ATTACH-GAPTO = 'Test3'.
APPEND EM_ATTACH.
dATA : VAR1(80).
DATA : ATTACH_REC TYPE I.
DATA: OBJPACK LIKE SOPCKLSTI1 OCCURS 2 WITH HEADER LINE,
OBJHEAD LIKE SOLISTI1 OCCURS 1 WITH HEADER LINE,
OBJBIN LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE,
OBJTXT LIKE SOLISTI1 OCCURS 10 WITH HEADER LINE,
RECLIST LIKE SOMLRECI1 OCCURS 5 WITH HEADER LINE,
DOC_CHNG LIKE SODOCCHGI1,
TAB_LINES LIKE SY-TABIX.
Creation of the document to be sent
DOC_CHNG-OBJ_NAME = 'Mat Attach'.
*DOC_CHNG-OBJ_DESCR = 'Please check the error message'(002).
DOC_CHNG-OBJ_DESCR = P_TITLE.
APPEND LINES OF EM_BODY TO OBJTXT.
DESCRIBE TABLE OBJTXT LINES TAB_LINES.
READ TABLE OBJTXT INDEX TAB_LINES.
DOC_CHNG-DOC_SIZE = ( TAB_LINES - 1 ) * 255 + STRLEN( OBJTXT ).
*Creation of the entry for the compressed document
CLEAR OBJPACK-TRANSF_BIN.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 0.
OBJPACK-BODY_START = 1.
OBJPACK-BODY_NUM = TAB_LINES.
OBJPACK-DOC_TYPE = 'RAW'.
APPEND OBJPACK.
DESCRIBE TABLE EM_ATTACH LINES ATTACH_REC.
IF ATTACH_REC GE '1'.
*Start of email attachement of internal table conversition
*objbin = 'From Code To Code Gap from Gap to'.
*append objbin.
APPEND LINES OF EM_ATTACH TO OBJBIN.
*end of email attachement of internal table conversition
DESCRIBE TABLE OBJBIN LINES OBJPACK-BODY_NUM.
OBJPACK-TRANSF_BIN = 'X'.
OBJPACK-HEAD_START = 1.
OBJPACK-HEAD_NUM = 1.
OBJPACK-BODY_START = 1.
OBJPACK-DOC_SIZE = OBJPACK-BODY_NUM * 255.
OBJPACK-DOC_TYPE = 'TXT'.
OBJPACK-OBJ_DESCR = 'Missing Zip code ranges'. " Description
APPEND OBJPACK. CLEAR OBJPACK.
ENDIF.
*Completing the recipient list
RECLIST-RECEIVER = '[email protected]'.
RECLIST-REC_TYPE = 'U'.
APPEND RECLIST.
CLEAR RECLIST.
Sending the document
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
DOCUMENT_DATA = DOC_CHNG
PUT_IN_OUTBOX = 'X'
COMMIT_WORK = 'X'
TABLES
PACKING_LIST = OBJPACK
OBJECT_HEADER = OBJHEAD
CONTENTS_BIN = OBJBIN
CONTENTS_TXT = OBJTXT
RECEIVERS = RECLIST
EXCEPTIONS
TOO_MANY_RECEIVERS = 1
DOCUMENT_NOT_SENT = 2
OPERATION_NO_AUTHORIZATION = 4
OTHERS = 99.
IF SY-SUBRC = 0.
WRITE:/ 'MAIL Sent'.
ENDIF.
hERE IS THE sample code of txt attachments. -
Sending xml file from client to servlet
Hi,
I am writing the server component of an applcation, such that it will receive xml files from the clients(standalone application similar to javaSwing stuff but it's coded in C#), and the servlet will have to extract the data from the xml file and update the mySql database. it will also fulfill the client's request for xmlFiles (and extract data from DB, format to xml file and send back to client)
I'm new to implementing the servlet receiving files from clients so would need some help.
I've got 3 questions to ask:
1) How does the servlet receive/returns the xml file from the client as a series of httpPost request/response. Do i send a File or the file's contents as a String to/from the client?
2) Is it also a must to use socket for the file transfers? I have read in other posts about sockets as well as HttpURLConnection but i don't quite understand.
3) When I send a file back to the client(client is standalone application written in C# whereas server is coded in java), what do i specify for the HttpResponse.setContentType() in my servlet? (i'm returning the xml file to client)
Would really appreciate for any help rendered. If you have any useful links, would appreciate them too. Thanks a lot.
KarenI've got 3 questions to ask:
1) How does the servlet receive/returns the xml file
from the client as a series of httpPost
request/response. Do i send a File or the file's
contents as a String to/from the client?The server will listen on some port for requests. The client has to open a socket to this server to send the file as string to the server.
see http://java.sun.com/docs/books/tutorial/networking/index.html
>
2) Is it also a must to use socket for the file
transfers? I have read in other posts about sockets as
well as HttpURLConnection but i don't quite
understand.You use HttpURLConnection to make a request using the http protocol, instead of opening a socket and then writing the html headers yourself.
3) When I send a file back to the client(client is
standalone application written in C# whereas server is
coded in java), what do i specify for the
HttpResponse.setContentType() in my servlet? (i'm
returning the xml file to client)Its up to your receiving program how to interpret this though, so you probably dont need this. -
How to update a table AUTOMATICALY with data from a .txt file??
HI ,
I want to upload data which is in a notepad file and Create a table. This notepad file stores a string of datas. Here, the data comes in to the .txt file every second.
(The data is actually stored into the notepad file when a program is executed in Processing.js software)
Is it possible to do the following using APEX ? ?
1. This table has to be updated automatically once in 2 minutes (I want this completely automatic, no human intervention -- no update buttons)
2. A report is to be created in a apex application with this table, it should reflect the updates in the table every 2 minutes.
Is it possible?? give your ideas.. I want to do this soon for my engineering project :) Any help from you is appreciated. :)
Edited by: user13301695 on 28-Mar-2011 10:09And how do you expect your database server to access a local file in your machine ?
Is the file accessible from outside your machine say inside a webserver folder so that some DB process can poll on the file ?
Or, is your DB server in the same machine where you have the text file ?
You will have to figure out the file acess part before automating user interaction or even auto-refreshing. -
Report with Access Database or TXT file
Dear All,
I was wondering if someone can help me with the following issue.
We have created a Crystal Reports XI report which has a Access MDB or Plain Text file as source data (2 different reports; one with MDB connection only and the other one with a Lotus Notes ODBC connection and TXT file).
The report runs correctly locally and it also runs correctly on the server but as soon as I post the report via the repository folder to the server, it does not work anymore.
Viewing the report via InfoView gives me a password request while both, the MDB and TXT file are not password protected.
We have tried to make system DSN and file DSN connections to both the MDB and TXT file but also this ends with a password request which is not defined.
Did anyone came across this as well? Any idea about a solution?
Thank you in advance,
Annique.Hi Annique,
Since this works in CR Designer I'm moving your post to the Business Objects forum.
It's likely due to BOE servers not having access to the data sources. Make sure you put them in a folder that the WEB server and BOE Servers have access to. To prompt for log on is because we can't find the data files.
Thank you
Don -
Problem with nextDouble when reading txt files
Hello, im very new to java and im trying to read a double number from a text file but I get an error if i dont write int values, for example:
my txt file:
John Smith
32.5part of my Java code:
out.println(myScanner.nextLine());
out.println(myScanner.nextDouble());(myScanner read my text file)
but I get this error:
Exception in thread "main" java.util.InputMismatchException
at java.util.Scanner.throwFor(Scanner.java:840)
at java.util.Scanner.next(Scanner.java:1461)
at java.util.Scanner.nextDouble(Scanner.java:2387)
at TeamFrame.<init>(TeamFrame.java:15)
at Baseball.main(Baseball.java:14)
Im following the Java for dummies book and according to the book this should work.(Please post using the {code} tags - you put {code} at the start of your code and again at the end so that it's readable when it appears here. If nobody has replied to your post you can edit it and put the tags in now.)
The code you posted doesn't correspond to the data you posted originally.
Also when you say "nextLine()" the scanner reads and return s a line and it moves to the next line. But when you say "nextInt()" or "nextDouble()" it doesn't move to the next line even when there's nothing but an int or a double on the line it's reading. That's because there is a newline character and the scanner stops just before that.
The solution is to say nextLine() straight after every nextInt() or nextDouble(). The nextLine() - whose result you just throw away - will move you to the next line.
You do this in the case of the int you read, but not in the case of the doubles.
Edited by: pbrockway2 on Jan 3, 2008 12:35 PM
Posted with regard to:import java.util.Scanner;
import java.io.File;
import java.io.IOException;
public class Baseball {
public static void main(String[] args) throws IOException {
Scanner myScanner = new Scanner(new File("C:\\Users\\Dennis\\Documents\\
JCreator LE\\MyProjects\\first\\Baseball\\src\\
Hankees.txt"));
int nrPlayers = myScanner.nextInt();
myScanner.nextLine();
for (int num = 1; num <= nrPlayers; num++) {
String name = myScanner.nextLine();
double average = myScanner.nextDouble();
} -
Send a file to the printer!
Hello,
is it possible to send a file, that is generated with the
printer-driver, to a network-printer? This should be done with LabVIEW
6i
Jens[email protected] (VI Guy) wrote in <5065000000050000007CAB0000-1031838699000
@exchange.ni.com>:
>Yes and no.
>
>The printer has to be of the type that allows this (I don't know the
>exact requirement but some printers allow it and others don't).
>
>Set up your computer so the network printer is "mapped" to printer
>port like "LPT1" or "LPT2" (If I recall this requires you to answer
>yes to the "Do you print from MS-DOS applications?" during the "Add a
>Printer" wizard).
>
>Then, you will need to use the "Shell Exec.vi" and do a "COPY /B
>Filename.bin LPT1", given that "Filename.bin" is the file you created
>with the print driver and "LPT1" is the port you mapped your printer
>to.
>
Alternatively if it's just a plain old text printer, you can use the serial
vi's
to send the text directly to a line printer using COM10. Note that you
will have to include a line in your labview.ini file (and in the ini file
with your built application) that allows you to access com10. The line is
something like:
"serialDevices=com1;com2;com3"
but a search on using the line printer on the NI website will reveal the
correct key and entry.
Alexander C. Le Dain, PhD
ICON Technologies Pty Ltd
http://www.icon-tech.com.au
* The LabVIEW FAQ http://www.icon-tech.com.au/thelabviewfaq.html * -
Whenever I send a file to my Xerox C75 from my Mac (Yosemite), the file goes to the printer okay, then InDesign crashes.
I think there is a patch specifically for this issue. Where do I find it?Yes, I have Fiery Hot Folders Console. That is certainly an alternative that should work as I can then avoid having to choose Fiery Features from the print dialog box in order to choose the paper tray and other features I need.
I am about to try a clean install of OS 10.9.3, and I am not the least bit happy about it. Adobe CC is my main set of go-to applications for my work, and those are the only applications that give me ANY problems with printing. I have forked out real money on different versions since I started using Adobe in the late 1990's, and my troubles seem to increase with every new release.
Maybe you are looking for
-
I'm having problems with CS2 (mainly illustrator and photoshop
I'm having problems with CS2 (mainly illustrator and photoshop ) randomly shutting down while trying to save a file. Reformatted my laptop for fear of a virus and reloaded... I have gotten nowhere. Please Help!
-
Is it safe to only use one 8GB module in my MacBook Pro 13?
I am looking to upgrade my MacBook Pro 13: Is it safe to use just one module instead of two? Cheers!
-
Disabling multiple row selection in JTable
hi, I have a JTable and I want to disable the multiple row selection. I used getSelectionModel().setSelectionMode(TreeSelectionModel.SINGLE_TREE_SELECTION);and this working fine with ctr+clicking on a row but if i am using shift key instead of Ctrl k
-
II'm trying to resolve an issue that I have with my iPhone 4s through QuickTime. I think it might be an embedded mms that might broadcasts my info as well as allows remote access sometimes. Any answers or similar activity?, I can support with screens
-
Custom sort order right after import
right after an import I start culling and basic editing. From here I will rename, keyword, and proof, than I file the images in the appropriate folder. But before renaming and proofing I may need to change the order of images. LR does not allow you t