Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 410 results for
fileinput
- Page 1
fileinput confusion :(
Programming
Software Development
12 Years Ago
by Skrell
…i get at the command prompt. PLEASE help. [CODE] import
fileinput
, sys, string, os def main(): searchterm = sys.argv[1…;removed" else: print item print targetdir for line in
fileinput
.input(targetdir): num_matches = string.count(line, searchterm) if num_matches:…
Re: Fileinput from files ignoring incorrect ones.
Programming
Software Development
12 Years Ago
by TrustyTony
What you catched from
fileinput
documentation?
Re: Fileinput from files ignoring incorrect ones.
Programming
Software Development
12 Years Ago
by TrustyTony
… with bunch of Python files as arguments. You did read
fileinput
documentation? I use the mention that empty files are opened…
(newb) fileinput.input IOError handling
Programming
Software Development
12 Years Ago
by Skrell
I am trying to use the
fileinput
.input() module to read in the lines from a bunch … items in the list i'm feeding
fileinput
,input() generates this IOError, i can get
fileinput
to simply continue onto the next…
Re: (newb) fileinput.input IOError handling
Programming
Software Development
12 Years Ago
by Skrell
…work. Here is my code: [CODE] try: for line in
fileinput
.input(newlist): num_matches = string.count(line, searchterm) if num_matches:… %s on line %d." % (searchterm, num_matches,
fileinput
.filename(),
fileinput
.filelineno()) except IOError: print "There was a problem with…
Re: (newb) fileinput.input IOError handling
Programming
Software Development
12 Years Ago
by TrustyTony
You must put try around the
fileinput
that is in try to line "5.5" and indent the print line and 7 to same level as try: (current print indention).
Re: (newb) fileinput.input IOError handling
Programming
Software Development
12 Years Ago
by TrustyTony
Actually I did not realize you are using
fileinput
as iterator already in for line. To get hat to work I think you must wrap it in function passing IOErrors. string.count is not also good style, you should use the method of string itself: "abcd".count("a")
Array Calculations
Programming
Software Development
14 Years Ago
by ThomasII
…(","c) tran.TransactionDate =
fileInput
(0) tran.DepoOrWith =
fileInput
(1) tran.TransactionAmount =
fileInput
(2) tran.PreviousBalance =
fileInput
(3) ReDim Preserve m_transSet(x) m_transSet…
The class returns an error message
Programming
Software Development
14 Years Ago
by puppykillaz
…(","c) tran.TransactionDate =
fileInput
(0) tran.DepoOrWith =
fileInput
(1) tran.TransactionAmount =
fileInput
(2) tran.PreviousBalance =
fileInput
(3) ReDim Preserve m_transSet(x) m_transSet…
Re: The class returns an error message
Programming
Software Development
14 Years Ago
by puppykillaz
….Split(","c) tran.TransactionDate =
fileInput
(0) tran.DepoOrWith =
fileInput
(1) tran.TransactionAmount =
fileInput
(2) tran.PreviousBalance =
fileInput
(3) m_transSet(x) = tran listDisplay…
Re: The class returns an error message
Programming
Software Development
14 Years Ago
by Oxiegen
….Split(","c) tran.TransactionDate =
fileInput
(0) tran.DepoOrWith =
fileInput
(1) tran.TransactionAmount =
fileInput
(2) tran.PreviousBalance =
fileInput
(3) m_transSet(x) = tran listDisplay…
I am using webcam for live snap, i am not getting image name
Programming
Web Development
9 Years Ago
by ramsiva
…class="
fileinput
fileinput
-new" data-provides="
fileinput
"> <div class="
fileinput
-new thumbnail&…</div> <div class="
fileinput
-preview
fileinput
-exists thumbnail" style="max-width: 200px…lt;/span>--> <span class="
fileinput
-exists"> Change </span> …
Re: Initilizing char var from file input
Programming
Software Development
13 Years Ago
by Greywolf333
…gt; using namespace std; void openFile() { ifstream
fileInput
;
fileInput
.open("testInput.txt"); if (!
fileInput
.is_open()) cout << "Error. … a; cout << a; } int main() { ifstream
fileInput
; openFile(); accessFile(
fileInput
); return 0; }[/code][/QUOTE] Anything you declare inside a…
Java program help!.please
Programming
Software Development
16 Years Ago
by cbtshare
… card holder"); String chname = input.next(); for (;
fileInput
.hasNext() ;) { String temp2 =
fileInput
.next().toLowerCase(); String temp = chname.toLowerCase(); if (temp.equals…
Initilizing char var from file input
Programming
Software Development
13 Years Ago
by myk326
…My problem seems to be with this line:
fileInput
>> a; Because it outputs nothing… std; void openFile() { ifstream
fileInput
;
fileInput
.open("testInput.txt"); if (!
fileInput
.is_open()) cout << &….\n" ; } void accessFile(ifstream&
fileInput
) { char a;
fileInput
>> a; cout << a…
updating jlabel
Programming
Software Development
15 Years Ago
by deerowbear
…tojt.exe"; String
fileInput
= s.next().toString(); String fileName =
fileInput
.substring(
fileInput
.lastIndexOf("\\"),
fileInput
.lastIndexOf(".")); String… textArea.updateUI(); textArea.repaint(); String[] cmd = { exe,
fileInput
, out, fileOutput }; Process D = r.exec(cmd); try …
Re: The class returns an error message
Programming
Software Development
14 Years Ago
by Oxiegen
… Dim line As String = "" Dim
fileInput
() As String If NameOfAccount.Equals("Savings") …COLOR] tran = New Transaction()
fileInput
= line.Split(","c) tran.TransactionDate =
fileInput
(0) ....... [COLOR="Red&…
Reading input from a File
Programming
Software Development
9 Years Ago
by Fatima_110
…count = 00000; String symbol =
fileInput
.next(); int quantity =
fileInput
.nextInt(); while (
fileInput
.hasNext()) { Stock myStock = new….getPrice()); totalValue += total; symbol =
fileInput
.next(); count++; quantity =
fileInput
.nextInt(); count++; } output.printf("…
Re: Python Phone Book Trouble!!
Programming
Software Development
14 Years Ago
by woooee
… == 2: phoneNumber.append(myString) count = count + 1
fileInput
.close() [/CODE] And finally, this piece of code reads …the file twice. The myList =
fileInput
.read() statement reads the entire file into myList. The… for myString in
fileInput
: statement reads one record at a time, except…
Algorithm Problems
Programming
Software Development
19 Years Ago
by Lord Felix
…; public Life(String input, String output) { inFile = new
FileInput
(input); outFile = new FileOutput(output); } public void cellConstruct() … System.out.println(""); Life lifeS = new Life(
fileInput
,"fileout.txt"); lifeS.cellConstruct(); lifeS.execute(numberOfSteps);…
How do I use methods outside of the main program?
Programming
Software Development
15 Years Ago
by jakethesnake86
… */ string debugger::parser(char* file, int line) { ifstream
fileinput
;
fileinput
.open(file); if(!
fileinput
) //if the file could not be opened, print an… line and store it in the string, data { getline(
fileinput
, data); ++curline; }
fileinput
.close(); return(data); } } /*Parameters: Parsed character that could …
Re: Reading input from a File
Programming
Software Development
9 Years Ago
by Fatima_110
… loop. so my loop would be: while (
fileInput
.hasNext()) { String symbol =
fileInput
.next(); int quantity =
fileInput
.nextInt(); Stock myStock = new Stock(symbol); double…
Need help on FileWrite function.
Programming
Software Development
19 Years Ago
by Buchas
… TForm1::FormActivate(TObject *Sender) { AnsiString FileName; const void *
FileInput
= Label1->Caption;; int FileHandle; FileName = "Logs…fmOpenWrite);} else { FileHandle = FileCreate(FileName);} FileWrite(FileHandle,
FileInput
, sizeof(Label1->Caption)); //write smth into file …
I still need help with my program!!
Programming
Software Development
17 Years Ago
by silentcreeper
…close(); } public static void main(String[] args) { File textFile; Scanner
fileInput
= null; Scanner fileInput2 = null; JFileChooser chooser = new JFileChooser(); // ….getSelectedFile(); // Try instantiating Scanner object with File object provided try {
fileInput
= new Scanner(textFile); } catch (FileNotFoundException e) { // Maybe …
Re: I still need help with my program!!
Programming
Software Development
17 Years Ago
by silentcreeper
…][/B] main(String[] args) { File textFile; Scanner
fileInput
= [B][COLOR=#7f0055]null[/COLOR][/B]; Scanner fileInput2 …int[/COLOR][/B] numWords = [I]wordCount[/I](
fileInput
); System.[I][COLOR=#0000c0]out[/COLOR][/I].println…;[/COLOR]); [I]printArray[/I](uniqueArray, numEachUnique);
fileInput
.close(); System.[I][COLOR=#0000c0]out[/COLOR][/I…
GroceryStore Simulation Java help
Programming
Software Development
15 Years Ago
by yingfo
…void readInventory(String filename) { Scanner
fileInput
; File inFile = new File("inventory.…dat"); try {
fileInput
= new Scanner(inFile); while(
fileInput
.hasNext()) { GroceryItem.readItem(
fileInput
); ++inventory; //stick…
Re: GroceryStore Simulation Java help
Programming
Software Development
15 Years Ago
by arseniew
…quot;inventory.dat"); try {
fileInput
= new Scanner(inFile); while(
fileInput
.hasNext()) { //You havent got …= new GroceryItem(); // creating new item tempItem.readItem(
fileInput
); // filling it with data dataList[inventory] = tempItem…
Python Phone Book Trouble!!
Programming
Software Development
14 Years Ago
by idreu2go4it
…\ CSCD 110 Assignments\entries.txt"
fileInput
= open("entries.txt", "r…") myList =
fileInput
.read() count = 0 for myString in
fileInput
: myString = myString.strip() myString = …2: phoneNumber.append(myString) count = count + 1
fileInput
.close() # Set up menu choice for looking up last…
Function Returning List
Programming
Software Development
13 Years Ago
by spacemanspiff92
[CODE]def exportTextList(
fileInput
, wordList): fileOpen = open(
fileInput
) for line in fileOpen: line = line.rstrip(&…wordList = wordList + lineList return wordList def main():
fileInput
= 'PlayerNames.txt' wordList=[] exportTextList(
fileInput
, wordList) print wordList[/CODE] My code summary:…
Read from a file then placing strings into a 2d array
Programming
Software Development
16 Years Ago
by controlsi
…", "r")) !=NULL) { while ((
fileInput
= fgetc(input)) != EOF) { printf("\n … ");//emove strcpy(input, word); putchar(
fileInput
); fillArray(word); } printf("Failure in…
1
2
3
7
Next
Last
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Meet People
Forums
Top Members
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC