What I'm trying to do is parse a CSV file that has column headers, and map those headers - ideally to a class. The tricky part is that I need to be able to support various mappings because it will be interacting with different systems that give the headers different names. Additionally, being able to combine fields would be extremely helpful. Fortunately, the CSV will always be correctly formatted with all fields encapsulated in double quotes. Example [I][U]system1Data.csv[/U][/I] [CODE]"Address", "City", "State", "Zip" "001 Test Rd", "New York", "New York", "10001"[/CODE] [I][U]system2Data.csv[/U][/I] [CODE]"Street Number", "StreetName", "StreetSuffix" "City", "State", "Zip-5" "001", "Test", …

Member Avatar
Member Avatar
+0 forum 8

Here's an easy one for you experts :P What is casting and parsing? How exactly are they different? After explaining, could anyone possibly tell me how to cast/parse the various types from and to each other? (the types being: int, double, char and String) Also, in which situations would I end up using either one of these? Thanks :D

Member Avatar
Member Avatar
+0 forum 1

I am using getline to read a CSV file. The line it reads looks something like "1/24/2010 6:19 1/24/2010 6:59 Merrill - Valley Farms yhy 69 Vegetation 55" The getline works but, I need to be able to calculate time days between a date the user inputs and the date here. AKA the first few characters in the line. I have tried to use assign and store them to arrays, which works great expect for sometimes the month is 1 or it could be 10, 11 or 12 and then assign does not work correctly. I have also tried strchr …

Member Avatar
Member Avatar
+0 forum 1

i have a program in c language that reads csv file.. now i want to read data column wise.. i want the whole program..which will take file name as command line argument and will fetch second column from the file.. lets assume file is like below.. aggromat,"1","abc","8903" aggromat,"2","abc","ddds" reply as soon as possible.

Member Avatar
Member Avatar
+0 forum 19

How to find errors in a given xml file, for e.g., in the following xml file.... <?xml version="1.0" encoding="ISO-8859-1"?> <bookstore> <book category="cooking"> <title lang="en">Everyday Italian</title> <author>Giada De Laurentiis</author> <year>2005</year> <price>30.00</price> </book> <book category="children"> <title lang="en">Harry Potter</title> <author>J K. Rowling</author> <year>2005</year> <price>29.99</price> </book> <book category="web"> <title lang="en">XQuery Kick Start</title> <author>James McGovern</author> <author>Per Bothner</author> <author>Kurt Cagle</author> <author>James Linn</author> <author>Vaidyanathan Nagarajan</author> <year>2003</year> <price>49.99</price> </book> <book category="web" cover="paperback"> <title lang="en">Learning XML</title> <author>Erik T. Ray</author> <year>2003</year> <price>39.95</price> </book> </bookstore> Expecting ur reply, as early as possible, With Thanks & Regards, Srinivasan.G

Member Avatar
Member Avatar
+1 forum 1

I'm looking for a tool that can read text on a web page, or within a web-based document viewer, and insert a polling plugin of sorts at the end of each paragraph. More specifically, I would like my website to display documents inside some kind of reader. Then, I'd like the ability to automatically insert a 'thumbs-up' or 'thumbs-down' button at the end of each paragraph or sentence. I know this could be done manually on a standard web page. But, I manage lengthy documents that are collaborated on by multiple individuals. A manual solution would be too time consuming. …

Member Avatar
Member Avatar
+0 forum 4

I am trying to get Domain names/URLs from the title and description in ebay, but the text varies a lot. Note that the url/domain names are limited to *.com, *.net, *.info, etc. For instance, I'd have to parse through text such as: IPAD SCREEN LENS.COM 3 4 5 Letter LLLL CCC Domain Name [have to get IPADSCREENLENS.COM here] Argyle Socks.info - Website DOMAIN NAME For Sale! [have to get ARGYLESOCKS.INFO] Buyer Work.com Website DOMAIN NAME For Sale NR![have to get BUYERWORK.COM] Besides this, I was able to get some "possible" URLs listed like so: [ICODE]Buyer Work.com Website DOMAIN NAME For …

Member Avatar
Member Avatar
+0 forum 2

i want to parse a file,my problem is in lines 2,3,4 of each person(every 4line make a person from my class person)numbers of my variables in lines 2,3,4 changed.i want to push_back each of variable in line 2 in a vector until it comes to "\n",i want to continue this work(make person)until the cursor comes to "---------------" this is a sample of my text file: David bekham 105700 -6.42372e+006 12345 mac vaio dell lenovo 50 30 40 Messi -105700 1.49887e+007 toshiba acer dell asus 50 70 53 C.Ronaldo 6.39639e+006 21415 msi dell lenovo 30 42 14 --------------- more details: [url]http://i52.tinypic.com/2j0nn8g.png[/url]

Member Avatar
Member Avatar
+0 forum 4

How will I parse this XML using jQuery? <item> <station></station> <headline><![CDATA[]]></headline> <showDate>12/28/2010</showDate> <showTime></showTime> <doorsOpen></doorsOpen> <buylink></buylink> <description><![CDATA[]]></description> <pubDate>Mon, 27 Dec 2010 10:48:28 PST</pubDate> </item> I have to display month and date separately..

Member Avatar
Member Avatar
+0 forum 1

I am working on a project where I need to parse a bunch of user text that comes in different fields. The problem is that the user input doesn't always come in on the same fields. One user might have a name in field 3 and a date in field 5, while another user might have names in fields 1 and 2, and a date in field 3. The first thing my code needs do is figure out what type of information is in what field. I don't want to reinvent the wheel. Has anyone come across some open source …

Member Avatar
Member Avatar
+0 forum 9

i have the following xml file.how to display the first tag (tag by tag) then when next button are click the second tag is display <?xml version="1.0"?> <records> <reg > <name>hari</name> <age>22</age> <mark>67</mark> </reg> </records> <records> <reg > <name>hari</name> <age>20</age> <mark>78</mark> </reg> </reg> <reg> <book > <name>hari</name> <age>21</age> <mark>88</mark> </reg> </records>

Member Avatar
Member Avatar
+0 forum 1

i have a XML file containing data, i want to parse it in c. can you help me out in parsing.

Member Avatar
Member Avatar
+0 forum 1

Best way to parse this webpage private info: [url]https://ee.ekool.eu/index_et.html?r=2#/?screenId=g.user.login&err=1[/url] I found Beautiful soap and PyKhtml. What is the better?

Member Avatar
Member Avatar
+0 forum 8

Hi, still very new to the C Language and just needed some Clearing up and some help please. Im writing a program where i have to read from a file that says the name of a person and 6 "lottery" numbers in this format. [ Mike Kobalt 12 15 34 37 45 50] Then the user inputs the winning numbers and the output is the name and how much they won. My question is How would we compare the winning numbers with the numbers from the text using parsing and malloc. Heres my code so far...keep in mind im new …

Member Avatar
Member Avatar
+0 forum 4

Hello all, I want to make a Python program which will go to a particular site, login with my credentials, and do a specific task, such as in this case: go to WordPress.com, login, navigate to the drafts section, and add a line to a draft. I believe most of the tasks come under "HTML Parsing" [could anyone explain to me what it is?]. The only thing I want to know is: what modules do I have to learn before I can start my project? Thanks all

Member Avatar
Member Avatar
+0 forum 2

Hi all, Basically I am attempting to determine whether the first 2 columns (tab delimited file) from file1.txt match the first 2 columns of file2.txt. If they do I want to output the entire row of file1.txt to outputfile.txt... I can do this using vbs but due to the amount of data that this is going to have to trawl through it's not an option. Can anyone please help? Many thanks :)

Member Avatar
Member Avatar
+0 forum 9

Hi, I am looking for advice on the best way to achieve my current goal. I am reading a textfile and extracting information from each line. For example string1 and string2. I am then writing these string to a datatable. However, sometimes there will be repeats in string1 and string2. If there are repeated lines I would like to be able to delete the repeating line and add a counter to find the total number of repeating lines. so if a string repeates 3 times I would like there to be a column with a 3 displayed next to the …

Member Avatar
Member Avatar
+0 forum 3

Hello I am attempting to parse multiple lines of text from a text file using regexpressions. I am using vb.net with visual studio 2008. At the moment I am filling my datatable with the text file information and am able to return each line of text and parse the first set of numbers that I am attempting to break up. I have multiple string with varying lengths of character lengths and numeric lengths however the delimiters are sometimes different. Sometimes will be whitespace and sometimes will be whitespace and chars. But is always 2 spaces. Here is my code: [CODE] …

Member Avatar
Member Avatar
+0 forum 1

Well, I have a test program, in which I wanted to test if it was possible to open a textfile(text.txt) for input, display it via cout, then passing the object via reference to another function, in it and display the file again(which should already be open,which is the whole point). The thing is that, it does show it's open(via is_open()), but it doesnt display anything, inside the test() function, but it does inside the main() function. I would like for someone to help me make this program to display the input file inside the test() function. Here is the code …

Member Avatar
Member Avatar
+0 forum 1

I need to do CSV parsing and I was wondering if this is possible with python and where I should go to learn how to code this script or get help. Let's say I have a CSV file with 20 rows and 4 columns. I need to: -Strip out the first five rows -Strip out the last three rows -Strip out the 2nd and 4th columns -Convert the dates in the 3rd column from format DD-MM-YYYY to MMM-DD (so for example, a 14-05-1999 gets converted to May-14) In the end, I'll have a CSV file with 12 rows and 2 …

Member Avatar
Member Avatar
+0 forum 4

I have a text file that looks like Y07976.1/124-271 Y07978.1/48-201 and I want to remove everything after the forward slash such that in the end the text file will look like Y07976.1 Y07978.1 I am currently learning perl and I think regular expressions are going to be a trouble for awhile but I thought about using [CODE] $line=~ s/\W.*//;[/CODE] but that removes everything after the "." and I want to keep the ".1". I appreciate any help. Thanks

Member Avatar
Member Avatar
+0 forum 2

Hi everyone, I would like to parse this text file PREVIT:nmrValidate_166w.pdb atoms "A -750 -GLU -CG " and "B -54 -GLN -CG " 3.8759 A apart atoms "A -750 -GLU -CD " and "B -54 -GLN -CG " 3.8447 A apart atoms "A -750 -GLU -C " and "B -51 -LYS -CE " 3.8431 A apart atoms "A -751 -PRO -CB " and "B -52 -ARG -CB " 3.7116 A apart atoms "A -751 -PRO -CB " and "B -52 -ARG -CD " 3.3998 A apart atoms "A -751 -PRO -CG " and "B -52 -ARG -CB " 3.4295 A …

Member Avatar
Member Avatar
+0 forum 7

I have a csv file that has 12 columns. I've been using: [code=c++] while(!infile.eof()) { getline( infile, source, ',' ); outfile << source << ", "; getline( infile, native_ID, ',' ); outfile << native_ID << ", "; getline( infile, index, ',' ); outfile << index << ", "; getline( infile, charge, ',' ); outfile << charge << ", "; getline( infile, cluster_ID, ',' ); outfile << cluster_ID << ", "; getline( infile, fdr, ',' ); outfile << fdr << ", "; getline( infile, precursor_mass , ',' ); outfile << precursor_mass << ", "; getline( infile, calculated_Mass, ',' ); outfile << …

Member Avatar
Member Avatar
+0 forum 1

Basically, after the user inputs a cvs file which is formatted like (unmod.cvs that is attached is complete file): Source, Native ID, Index, Charge, Cluster ID, FDR, Precursor Mass, Calculated Mass, Mass Error, Peptide, Mods, Search Scores /tumor/set2/mam_082208o_individualsamples_747T_set2_082008_A01,scan=771,770,2,46,0,1162.436,1162.438,0.001953125,NDDDEEEAAR,,(mvh 52.0926)(mzFidelity 69.9226) /tumor/set2/mam_082208o_individualsamples_747T_set2_082008_A01,scan=1147,1146,2,93,0,1436.543,1436.506,-0.0369873,AAEDDEDDDVDTQ,,(mvh 68.8836)(mzFidelity 92.7468) *note that the mods value is a space, hence the double commas after the Peptide ("NDDDEEEAAR") I need all those values to be copied and outputted in another file. I used the getline() function to get the values, and everything is copied fine to the output file. The problem I'm having though, is that I need to …

Member Avatar
Member Avatar
+0 forum 1

hi guys, I'm kind of new with xml. I have an xml file in the following format, with 592 records: [CODE]<?xml version="1.0" encoding="ISO-8859-1"?> <data> <item> <buildingName>Chateau</buildingName> <address>81 North Broadway, White Plains, NY</address> <mail>I</mail> <laundry>I</laundry> <garbage>I</garbage> <parking>I</parking> <rating>No Access</rating> <municipality>White Plains</municipality> </item> <item> <buildingName>44 Franklin Avenue</buildingName> <address>44 Franklin Avenue, New Rochelle, NY</address> <mail>A</mail> <laundry>A</laundry> <garbage>A</garbage> <parking>A</parking> <rating>Good Access</rating> <municipality>New Rochelle</municipality> </item> </data>[/CODE] I'm using the following code in order to read all the addresses: [CODE] var xml = GXml.parse(data); //this function is from google map API var addresses =xml.documentElement.getElementsByTagName("address"); for (var i = 0; i < addresses.length; i++) { showAddress(addresses[i].childNodes[0].nodeValue); } …

Member Avatar
+0 forum 0

Hello I want to parse html in treeview. I haven't made it because some html tags <br> not close. How can I load html content with parsing in a treeview

Member Avatar
Member Avatar
+0 forum 1

Hey Everyone... Not quite sure how it works on these forums as this is my first post, but I am looking to separate elements of lines printed to a text file in real-time for a log parser. An example of the text output is: [INDENT][CHAT WINDOW TEXT] [Sun Nov 29 11:34:38] Guardian of Water killed Kyton's Rebuke [BH][/INDENT] I would like to separate the two names (Guardian of Water and Kyton's Rebuke [BH]) and use the word killed as a keyword in an if...else... statement. Keep in mind however that the names can be extremely long or extremely short - …

Member Avatar
Member Avatar
+0 forum 20

Hello, I'm trying to convert a double (3.16) and take its integer part (3). However I'm encountering problems doing this. Can someone pleeease help me out ? Here is my code: [CODE]main: li $v0, 7 #asking the user for a double syscall mov.d $f2, $f0 cvt.s.d $f4, $f2 #converting from double to single precision. I have a #also tried to convert to word li $v0, 3 #print the value mov.d $f12, $f4 #move da converted value (ie.from 3.1 to 3) to f12 syscall[/CODE] All I want is to convert 3.16 to 3 so I can then only have the floating …

Member Avatar
+0 forum 0

I am trying to parse a xml document and extract certain information. I have looked around quite a bit and haven't been able to find anything that would suit my needs. the sample xml file would look like this: <contact> <name> Daffy Duck </name> <street> 15 Rodeo Drive </street> <city> Santa Monica</city> <state> California</state> <zip> 90210</zip> </contact> There would be multiple contacts in the file with this format. I am trying to extract and output only certain contacts depending on what zip code, state, city etc they live in. I want the code to be workable in C++ format. If …

Member Avatar
Member Avatar
+0 forum 1

I know that this is an easy one but it is hard for me to figure out. I need to make a program that can: * Open the file and read through all of the lines in the file. (got this) * If a line starts with "Subject:", skip the line. (got this) * For all the other lines, split the strings into a list of words using the white space and find the first word. After you have found the first word, split that string again into a *new* list of words using the "/" character. (got this I …

Member Avatar
Member Avatar
+0 forum 6

The End.