c++ excel cell blank cells
C++
#include <iostream>
#include <fstream>
#include <sstream>
#include <vector>
int main()
{
std::fstream file("myfile.txt");
std::vector<std::string> vec;
if(file.is_open())
{
std::string line;
bool Skip = true;
while(std::getline(file, line))
{
std::stringstream sstr(line);
std::string word;
while (std::getline(sstr, word, ' '))
{
if(!word.empty())
vec.emplace_back(word);
else if(word.empty() && Skip)
{
vec.emplace_back("NaN");
Skip = false;
}
}
Skip = true;
}
file.close();
}
for(size_t i = 0; i < vec.size(); ++i)
{
std::cout << vec[i] << " ";
if((i+1)%3 ==0) std::cout << std::endl;
}
return 0;
}
Also in C++:
- Title
- ue4 c++ struct
- Category
- C++
- Title
- create a dictionary cpp
- Category
- C++
- Title
- c++ function to find minimum element in array
- Category
- C++
- Title
- getting a random letter in c++
- Category
- C++
- Title
- c++ show time elapsed
- Category
- C++
- Title
- C++ int to char*
- Category
- C++
- Title
- powers of 2 in cpp
- Category
- C++
- Title
- range of long long in c++
- Category
- C++
- Title
- std string find character c++
- Category
- C++
- Title
- vector concat c++
- Category
- C++
- Title
- insert at position in vector c++
- Category
- C++
- Title
- how use global variables instead of local in c++
- Category
- C++
- Title
- how to pushback in vector
- Category
- C++
- Title
- length of string c++
- Category
- C++
- Title
- c++ argv
- Category
- C++
- Title
- c++ movment
- Category
- C++
- Title
- c++ sql
- Category
- C++
- Title
- c++ compiler for sublime text
- Category
- C++
- Title
- declare vectors c++
- Category
- C++
- Title
- delete a double pointer c++
- Category
- C++
- Title
- string to number in c++
- Category
- C++
- Title
- how to convert string into number
- Category
- C++
- Title
- pass vector by reference c++
- Category
- C++
- Title
- c++ clear console
- Category
- C++
- Title
- static variable in c++
- Category
- C++
- Title
- size of a matrix using vector c++
- Category
- C++
- Title
- Runtime Error: Runtime ErrorAbort signal from abort(3) (SIGABRT)
- Category
- C++
- Title
- find vector in c++
- Category
- C++
- Title
- min and max heap in cpp
- Category
- C++
- Title
- c++ code to print hello world
- Category
- C++
- Title
- c++ class member initialization
- Category
- C++
- Title
- c++ get last element in vector
- Category
- C++
- Title
- convert string to stream c++
- Category
- C++
- Title
- dijkstra in c++
- Category
- C++
- Title
- c++ string to vector int
- Category
- C++
- Title
- declaring 2d vector in c++
- Category
- C++
- Title
- user input c++
- Category
- C++
- Title
- c++ isalphanum
- Category
- C++
- Title
- preorder traversal
- Category
- C++
- Title
- building native binary with il2cpp unity
- Category
- C++
- Title
- binary search in set c++
- Category
- C++
- Title
- number of islands leetcode code
- Category
- C++
- Title
- reverse in vector c++
- Category
- C++
- Title
- advanced c++ topics
- Category
- C++
- Title
- c++ find prime numbers
- Category
- C++
- Title
- c++ tutorial
- Category
- C++
- Title
- power in c++
- Category
- C++
- Title
- c++ declare variable
- Category
- C++
- Title
- how to get last element of set in c++
- Category
- C++
- Title
- vector initialization c++
- Category
- C++
- Title
- restting a queue stl
- Category
- C++
- Title
- while loops
- Category
- C++
- Title
- bfs in C++
- Category
- C++
- Title
- jump to case label c++
- Category
- C++
- Title
- c++ formatting
- Category
- C++
- Title
- intersection between vector c++
- Category
- C++
- Title
- c++ replace substrings
- Category
- C++
- Title
- file format not recognized treating as linker script c++
- Category
- C++
- Title
- c++ vector add element
- Category
- C++
- Title
- c++ clear stream
- Category
- C++
- Title
- c++ give options
- Category
- C++
- Title
- Find the duplicate in an array of N integers.
- Category
- C++
- Title
- how to iterate trough a vector in c++
- Category
- C++
- Title
- fail() in c++
- Category
- C++
- Title
- pop_back
- Category
- C++
- Title
- double to int c++
- Category
- C++
- Title
- placement new c++
- Category
- C++
- Title
- substitution failure is not an error
- Category
- C++
- Title
- c++ program to input and print text using Dynamic Memory Allocation.loop
- Category
- C++
- Title
- heredar constructor c++
- Category
- C++
- Title
- fill c++
- Category
- C++
- Title
- C++ w3schools
- Category
- C++
- Title
- uepic games github
- Category
- C++
- Title
- inverser les éléments d'un tableau manuellement en c++
- Category
- C++
- Title
- c++ random numbers
- Category
- C++
- Title
- c++ empty stream
- Category
- C++
- Title
- c++ program how to let the user choose different game modes
- Category
- C++
- Title
- log base e synthax c++
- Category
- C++
- Title
- c++ ros subscriber
- Category
- C++
- Title
- how to iterate through a map in c++
- Category
- C++
- Title
- first prime numbers less than
- Category
- C++
- Title
- extends c++
- Category
- C++
- Title
- gfg right view of tree
- Category
- C++
- Title
- std::substring
- Category
- C++
- Title
- random number generator c++
- Category
- C++
- Title
- pause the console c++
- Category
- C++
- Title
- c++ create array
- Category
- C++
- Title
- git branch in my bash prompt
- Category
- C++
- Title
- appending a double to a string c++
- Category
- C++
- Title
- mao two drivers c++
- Category
- C++
- Title
- iterative inorder traversal
- Category
- C++
- Title
- __builtin_ctz
- Category
- C++
- Title
- how to input multiple lines of a file in c++
- Category
- C++
- Title
- % operator in c++
- Category
- C++
- Title
- compile c++ program
- Category
- C++
- Title
- how to cout in c++
- Category
- C++
- Title
- basic ex of maps in c++
- Category
- C++
- Title
- glfw initialize in c++
- Category
- C++
- Title
- c++ sort
- Category
- C++
- Title
- c++ program to find gcd of 3 numbers
- Category
- C++