Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

~6K People Reached
Favorite Forums
Favorite Tags
Member Avatar for Mattpd

Sorry I couldn't think of a better title, but thanks for reading! My ultimate goal is to read a .java file, parse it, and pull out every identifier. Then store them all in a list. Two preconditions are there are no comments in the file, and all identifiers are composed …

Member Avatar for SasseMan
0
149
Member Avatar for Mattpd

I am attempting to initialize an int[] array of 10 random numbers. Then choose a pivot value from the array. I then place this value in the first position of the array. Then call quicksort on the array, which will call a partition method. This method returns the final index …

Member Avatar for Mattpd
0
108
Member Avatar for Mattpd

My attempt of a "bubble sort" only partially works. Say for example if this is my structure declaration: [code] struct part { char name [NAME_LEN+1]; char owner [OWNER_LEN+1]; char status [STATUS_LEN+1]; char date [DATE_LEN+1]; char renter [RENTER_LEN+1]; } parts [MAX_PARTS], temp [1]; [/code] and the following code print: Piston:Mike:In:: Hook:Mark:In:: …

Member Avatar for Mattpd
0
160
Member Avatar for Mattpd

I need to grep a line from a text file, and delete the fourth and fifth field. then save it back to the text file. If that wont work I could also grep the line, and delete the first number and everything after it on that line. Both would accomplish …

Member Avatar for hichnam
0
149
Member Avatar for Mattpd

I officially have the worst C professor in the world. The guy hasn't answered my email in weeks and I don't have a class meeting before this assignment is due, so I have come here for some help. If anyone could point me in the right direction any part of …

Member Avatar for Trad
0
200
Member Avatar for Mattpd

My file contains: [CODE] Hook,Mark,In, , ,Tire,Matt,Out,01/01/2001,Mike [/CODE] My structure: [CODE] struct part { char name [NAME_LEN+1]; char owner [OWNER_LEN+1]; char status [STATUS_LEN+1]; char date [DATE_LEN+1]; char renter [RENTER_LEN+1]; } parts [MAX_PARTS], temp [1]; [/CODE] And the code: [CODE] FILE *fp; fp=fopen("parts.csv","r"); printf("%d", fp); //Added this for debugging char buf[100]; …

Member Avatar for Mattpd
0
382
Member Avatar for Mattpd

I am trying to take a user's input and assign it to a certain part of a structure. This code is in my book so I assume it's correct: [code] scanf("%d", &part_number); inventory[num_parts].number = part_number; [/code] I need to do the same thing but with a string instead of a …

Member Avatar for Mattpd
0
133
Member Avatar for Mattpd

Sorry, solved my own problem. [CODE] #include <time.h> time_t current = time(NULL); char date[11]; strftime (date, 11, "%m/%d/%Y", localtime (&current)); [/CODE]

0
67
Member Avatar for Mattpd

So I have this project to program an "auto parts management" C program. Basically I need to be able to add and delete lines of text from a text file. Also, I need to be able to edit lines of text. Lines of text are in the format: PART NAME …

Member Avatar for Mattpd
0
138
Member Avatar for Mattpd

I have written some bash shell scripts, using grep and sed. Are there any functions in C that do something similar to grep and mainly sed? I need to be able to edit and delete individual lines of text in an external txt file, based on user input.

Member Avatar for Ancient Dragon
0
95
Member Avatar for Mattpd

If I run the program, and select q, it will quit correctly. If I select e it goes to the edit menu [B]but prints it twice[/B]. If I then select q it goes to the main menu [B]and prints the default case, "please select from menu", then prints the main …

Member Avatar for kvprajapati
0
110
Member Avatar for Mattpd

In the title I was going to write (not C script) but they are essentially the same I think. My bad, anyway... I recently wrote a some SH scripts to manage lines of text in a separate txt file. Now my new assignment is to convert the whole thing to …

0
65
Member Avatar for Mattpd

My ultimate goal is to fill an array with user inputted positive and negative numbers. This script I wrote is very limited, but it should give you an idea of what I am trying to do. Basically, I ask how many numbers and then reserve 3 spaces for each number …

Member Avatar for Mattpd
0
181
Member Avatar for Mattpd

I am trying to delete any line of text that contains "$npname" and the word "in." The script works if $npname is only one word, but if it is more than one work I get "error: unterminated address regex" How can I fix this? [CODE]sed '/'$npname'.*in/d' parts.txt > parts.tmp[/CODE]

Member Avatar for Mattpd
0
4K
Member Avatar for Mattpd

If I have two lines of text: HOOK HOOK HOOK what is the syntax to grep just the first line without the second? and the second without the first?

Member Avatar for Xydric
0
119
Member Avatar for Mattpd

Hello all. New here. Another student looking for a little help. Technically I wouldn't consider this a homework question, as it is part of a much larger project for my class. My professor is little help so I'm here now. I hope you can help. I have a text file, …

Member Avatar for sknake
0
151
Member Avatar for Mattpd

I have declared a variable: [icode]today=$(date +%m/%d/%Y)[/icode] and I am trying to use sed to replace the word "in" with "out:date:name" but don't know the correct syntax to make $today print correctly. I have tried quotes and double quotes and brackets but to no avail. When I do it like …

Member Avatar for versatileint
0
83