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.

0 Endorsements
~8K People Reached
Favorite Forums
Favorite Tags
c++ x 76
Member Avatar for sadsdw

Hi friends, I wrote a simple code to write in different files but I don't know where I made mistake. The function is writing the first file and after writing everything in the second file, not in the next files 3,4, 5. Can anyone help me please? Thanks a lot! …

Member Avatar for sadsdw
0
101
Member Avatar for sadsdw

Hi there, I have a file with 500.000 columns and 300.000 lines. The format is like that: ColXX ColWW ColQQ ColTT ... ColEE H1 G1 H1 K1 ... L1 G1 H1 K1 L1 ... O1 . . . Based on the first line information, (ColXX to ColEE), what is the …

Member Avatar for Ancient Dragon
0
128
Member Avatar for sadsdw

Hi there, I need to change columns to rows and vice-versa. Example: 1001 AA AB AC AD 1002 CC DD EE FF 1003 AA BB CC CC 1004 DD DD DD DD to 1001 1002 1003 1004 AA CC AA DD AB DD BB DD AC EE CC DD AD …

Member Avatar for sadsdw
0
219
Member Avatar for sadsdw

Hi friends, I'm looking for an efficient method to transpose rows and columns from a BIG file. I wrote this code but is very inefficient. In that, I'm closing and opening a file many times. (// #*#) Could anyone help me please? Thanks a lot! [CODE] ifstream testTranspose; testTranspose.open("data.txt"); int …

Member Avatar for Ancient Dragon
0
139
Member Avatar for sadsdw

Hi friends, I'm retrieving some information from a input file with 10 columns and I need to get the first 3 columns and set into 3 different variables and the last 7 in the same variable. I was using "ifstream" and ">>" like: [CODE]myfile >> stringA; myfile >> stringB;[/CODE] ... …

Member Avatar for sadsdw
0
92
Member Avatar for sadsdw

Hi friends, I'm having a problem to write a file and read the same file in sequence. The file size is 4 GB. I tried fstream for both and as second option ofstream and ifstream. I'm reading just the first 2 lines of the file. If I read those in …

Member Avatar for sadsdw
0
242
Member Avatar for sadsdw

Hi there, I need to read a file with unknown number of columns and lines. Basically, I have an ID per line (ID00005) and many columns containing 2 letters. The format is: ID00005 RR WW SS QQ TT RR UU II ID00008 WW SS QQ YY HH JJ KK LL …

Member Avatar for sadsdw
0
481
Member Avatar for sadsdw

Hi friends, I wrote a code to build a matrix with specific calculations. When I'm using 3000 elements works well ... But I did a test with 150.000 (150.000 x 150.000) and I had problems. " terminate called after throwing an instance of 'std::bad_alloc' " I'm copying the code part …

Member Avatar for sadsdw
0
2K
Member Avatar for sadsdw

Hi friends, I have a map containing an int as key and a struct as second value, read from file. I need to update the second column with value obtained by the last value (bigger one) + 1. A kind of sequential code ... I tried to use the max_element …

Member Avatar for sadsdw
0
131
Member Avatar for sadsdw

Hi everyone, I have a std::map of structures . I'm reading the data from a file named "auxIdSorted.txt" and I need to do a while() using the variable auxID. The idea is read the map many times until all values of auxID become different of zero (while(auxID == 0). I …

Member Avatar for sadsdw
0
140
Member Avatar for sadsdw

Hello everyone, I have a std::map that includes individual ID and a struct that contains father and mother information, read from a file "ped.txt". This file has the format: ID - FATHER - MOTHER. Some fathers or mothers don't have IDs as individuals. The code bellow is an example to …

Member Avatar for sadsdw
0
756
Member Avatar for sadsdw

Hi everyone, I'm trying develop a code to read a file containing records of INDIVIDUAL ID, FATHER ID and MOTHER ID, and re-code the file using multiple trees. At this point I'm not concerning to re-code the IDs and I would like to build the multiple tree. The idea is: …

Member Avatar for sadsdw
0
109
Member Avatar for sadsdw

Hello everyone, I'm trying to declare a 2-dimension (A[][]) dynamic matrix but I'm having problems ... The A's elements need to be FLOAT. The size of lines and columns are both vectorX.size(). Could you help me please? One of error's message is: "cannot convert `double' to `float**' in initialization" [CODE] …

Member Avatar for sadsdw
0
106
Member Avatar for sadsdw

Hi everyone, I'm trying sort a C++ struct and print the result as output file. I don't know how to sort the structure. Did anyone develop this before? Thanks a lot, [CODE] #include <stdio.h> #include <stdlib.h> #include <iostream> #include <fstream> #include <string> #include <vector> #include <sstream> #include <algorithm> #include <cstdlib> …

Member Avatar for sadsdw
0
119
Member Avatar for sadsdw

Hi, I would like to ask about sorting lines in C++, (4 columns = 3 columns of integers and the last one a string): 3 56 3 NA 7 50 5 NA 2 100 1 OK I tried the function sort() using a vector of strings, but failed in cases …

Member Avatar for sadsdw
0
2K
Member Avatar for sadsdw

Hello friends, I'm looking for an short example to read a text file and get lines splitting in 3 vectors. I don't know how I'll do this ... E.G: 100 NAME1 30 150 NAME2 40 200 NAME3 50 -> vectorId[0] = 100 vectorName[0] = NAME1 vectorAge[0] = 30 Can you …

Member Avatar for sadsdw
0
189
Member Avatar for sadsdw

Hi friends, I would like to insert "whitespace" between the numbers of my string str3 and after concatenate with str1 and str2, as str1 << str2 << str3. This is an example: E.g.: 200 3 1 2 3 4 5 6 7 8 9 Could you help me? I had …

Member Avatar for sadsdw
0
95
Member Avatar for sadsdw

Hi friends, I have 3 different vectors, V1, V2 and V3. V1 and V2 have the same size and each line refers the same record. I would like to write a function that get each line from V3 and check if exists in V2, and if is == "M" in …

Member Avatar for sadsdw
0
125
Member Avatar for sadsdw

Hi friends, I'm having problems to use 2 consecutive "cin.get()". The second get() is not been accessed. But if debug I can answer the name of second file. Can you help me? Cheers, Sads [CODE]cout << "\nEnter the name of the first FILE : " << endl; cin.get (FileName1,256); cout …

Member Avatar for sadsdw
0
93
Member Avatar for sadsdw

Hi friends, I'm newer in C++ and I'm trying write a code using ifstream, vector and substr. A) I have 2 problems: A.1) When I read files with small number of lines OK, but if I increase the number of lines, PROBLEM. As example: file1.txt (Work well with 9 lines, …

Member Avatar for daviddoria
0
195
Member Avatar for sadsdw

Hi everyone, I'm recently in C++ and I would like to develop one C++ code that read a file ".txt" of strings and numbers with different size of columns and lines. After I need to get the frequencies of each element of the same column. Cheers, SADSDW Example: ABC DEF …

Member Avatar for Fbody
0
115