{"id":382,"date":"2023-05-24T12:48:52","date_gmt":"2023-05-24T12:48:52","guid":{"rendered":"https:\/\/www.jibsheet.net\/linux\/?p=382"},"modified":"2023-05-26T14:49:23","modified_gmt":"2023-05-26T14:49:23","slug":"chatgpt-creating-a-c-file-search-with-csv-output","status":"publish","type":"post","link":"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/","title":{"rendered":"ChatGPT &#8211; creating a C++ file search with csv output"},"content":{"rendered":"<p>I first started with Python and that worked well.\u00a0 I then did a perl version.\u00a0 \u00a0That went well.\u00a0 \u00a0So, I thought &#8211; why not go for the jugular &#8211; write a c++ one.\u00a0 I call it file_audit &#8211; save a csv formatted file so I can review and sort by date to see what I need to save or delete.\u00a0 This code requires &#8220;.pdf&#8221; not &#8220;pdf&#8221; for the extension.<\/p>\n<p>Here is my prompt<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">write a c++ program that take argv of --dir for directory, --csvfile for output csv file and type for extension file type such as .pdf or txt.   write the output to a the specified csv file, the csv file should contane file name, direcotry, size and date in format YYYY\/MM\/DD and time<\/pre>\n<p>Here is what it generated<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/ Include the necessary libraries\r\n#include &lt;iostream&gt;\r\n#include &lt;string&gt;\r\n#include &lt;filesystem&gt;\r\n#include &lt;fstream&gt;\r\n#include &lt;chrono&gt;\r\n#include &lt;iomanip&gt;\r\n\r\n\/\/ Use the std namespace\r\nusing namespace std;\r\n\r\n\/\/ Define a function to parse the command line arguments and return the values\r\nvoid parse_args(int argc, char* argv[], string&amp; dir, string&amp; csvfile, string&amp; type) {\r\n    \/\/ Loop through the arguments\r\n    for (int i = 1; i &lt; argc; i++) {\r\n        \/\/ Check if the argument is --dir\r\n        if (string(argv[i]) == \"--dir\") {\r\n            \/\/ Check if the next argument exists and is not another option\r\n            if (i + 1 &lt; argc &amp;&amp; argv[i + 1][0] != '-') {\r\n                \/\/ Assign the next argument to dir\r\n                dir = argv[i + 1];\r\n                \/\/ Increment i to skip the next argument\r\n                i++;\r\n            }\r\n            else {\r\n                \/\/ Throw an exception if the argument is invalid\r\n                throw invalid_argument(\"Missing or invalid value for --dir\");\r\n            }\r\n        }\r\n        \/\/ Check if the argument is --csvfile\r\n        else if (string(argv[i]) == \"--csvfile\") {\r\n            \/\/ Check if the next argument exists and is not another option\r\n            if (i + 1 &lt; argc &amp;&amp; argv[i + 1][0] != '-') {\r\n                \/\/ Assign the next argument to csvfile\r\n                csvfile = argv[i + 1];\r\n                \/\/ Increment i to skip the next argument\r\n                i++;\r\n            }\r\n            else {\r\n                \/\/ Throw an exception if the argument is invalid\r\n                throw invalid_argument(\"Missing or invalid value for --csvfile\");\r\n            }\r\n        }\r\n        \/\/ Check if the argument is --type\r\n        else if (string(argv[i]) == \"--type\") {\r\n            \/\/ Check if the next argument exists and is not another option\r\n            if (i + 1 &lt; argc &amp;&amp; argv[i + 1][0] != '-') {\r\n                \/\/ Assign the next argument to type\r\n                type = argv[i + 1];\r\n                \/\/ Increment i to skip the next argument\r\n                i++;\r\n            }\r\n            else {\r\n                \/\/ Throw an exception if the argument is invalid\r\n                throw invalid_argument(\"Missing or invalid value for --type\");\r\n            }\r\n        }\r\n        else {\r\n            \/\/ Throw an exception if the argument is unknown\r\n            throw invalid_argument(\"Unknown option: \" + string(argv[i]));\r\n        }\r\n    }\r\n}\r\n\r\n\/\/ Define a function to format a file time point as YYYY\/MM\/DD HH:MM:SS\r\nstring format_time(filesystem::file_time_type file_time) {\r\n    \/\/ Convert the file time point to system clock time point\r\n    auto sys_time = chrono::time_point_cast&lt;chrono::system_clock::duration&gt;(file_time - filesystem::file_time_type::clock::now() + chrono::system_clock::now());\r\n    \/\/ Convert the system clock time point to time_t\r\n    time_t tt = chrono::system_clock::to_time_t(sys_time);\r\n    \/\/ Convert the time_t to tm structure\r\n    tm local_tm = *localtime(&amp;tt);\r\n    \/\/ Create a string stream to format the output\r\n    stringstream ss;\r\n    \/\/ Write the year, month, day, hour, minute and second to the stream with leading zeros and separators\r\n    ss &lt;&lt; setw(4) &lt;&lt; setfill('0') &lt;&lt; local_tm.tm_year + 1900 &lt;&lt; \"\/\";\r\n    ss &lt;&lt; setw(2) &lt;&lt; setfill('0') &lt;&lt; local_tm.tm_mon + 1 &lt;&lt; \"\/\";\r\n    ss &lt;&lt; setw(2) &lt;&lt; setfill('0') &lt;&lt; local_tm.tm_mday &lt;&lt; \" \";\r\n    ss &lt;&lt; setw(2) &lt;&lt; setfill('0') &lt;&lt; local_tm.tm_hour &lt;&lt; \":\";\r\n    ss &lt;&lt; setw(2) &lt;&lt; setfill('0') &lt;&lt; local_tm.tm_min &lt;&lt; \":\";\r\n    ss &lt;&lt; setw(2) &lt;&lt; setfill('0') &lt;&lt; local_tm.tm_sec;\r\n    \/\/ Return the formatted string\r\n    return ss.str();\r\n}\r\n\r\n\/\/ Define a function to write the output to a csv file\r\nvoid write_csv(const string&amp; dir, const string&amp; csvfile, const string&amp; type) {\r\n    \/\/ Create an output file stream and open the csv file\r\n    ofstream ofs;\r\n    ofs.open(csvfile);\r\n    \/\/ Check if the file stream is open and ready\r\n    if (ofs.is_open()) {\r\n        \/\/ Write the header row to the csv file\r\n        ofs &lt;&lt; \"File Name,Directory,Size,Date\\n\";\r\n        \/\/ Loop through the directory entries in the given directory recursively\r\n        for (const auto&amp; entry : filesystem::recursive_directory_iterator(dir)) {\r\n            \/\/ Check if the entry is a regular file and has the given extension type\r\n            if (entry.is_regular_file() &amp;&amp; entry.path().extension() == type) {\r\n                \/\/ Write the file name, directory, size and date to the csv file with commas as separators and quotes as delimiters\r\n                ofs &lt;&lt; \"\\\"\" &lt;&lt; entry.path().filename().string() &lt;&lt; \"\\\",\";\r\n                ofs &lt;&lt; \"\\\"\" &lt;&lt; entry.path().parent_path().string() &lt;&lt; \"\\\",\";\r\n                ofs &lt;&lt; \"\\\"\" &lt;&lt; entry.file_size() &lt;&lt; \"\\\",\";\r\n                ofs &lt;&lt; \"\\\"\" &lt;&lt; format_time(entry.last_write_time()) &lt;&lt; \"\\\"\\n\";\r\n            }\r\n        }\r\n        \/\/ Close the file stream\r\n        ofs.close();\r\n    }\r\n    else {\r\n        \/\/ Throw an exception if the file stream is not open or ready\r\n        throw runtime_error(\"Failed to open or write to \" + csvfile);\r\n    }\r\n}\r\n\r\n\/\/ Define the main function\r\nint main(int argc, char* argv[]) {\r\n    try {\r\n        \/\/ Declare variables for directory, csv file and type arguments\r\n        string dir, csvfile, type;\r\n        \/\/ Parse the command line arguments and assign values to variables\r\n        parse_args(argc, argv, dir, csvfile, type);\r\n        \/\/ Write the output to a csv file with given arguments\r\n        write_csv(dir, csvfile, type);\r\n        \/\/ Print a success message to standard output\r\n        cout &lt;&lt; \"Output written to \" &lt;&lt; csvfile &lt;&lt; \"\\n\";\r\n    }\r\n    catch (const exception&amp; e) {\r\n        \/\/ Print an error message to standard error with exception message\r\n        cerr &lt;&lt; \"Error: \" &lt;&lt; e.what() &lt;&lt; \"\\n\";\r\n        return 1;\r\n    }\r\n}\r\n<\/pre>\n<p>cool and it compiles.<\/p>\n<p>I asked it to add a &#8220;-h&#8221; for help and got this.\u00a0 \u00a0I ended up just pasting in the changed section.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">\/\/ Define a function to parse the command line arguments and return the values\r\nvoid parse_args(int argc, char* argv[], string&amp; dir, string&amp; csvfile, string&amp; type) {\r\n    \/\/ Loop through the arguments\r\n    for (int i = 1; i &lt; argc; i++) {\r\n        \/\/ Check if the argument is -h\r\n        if (string(argv[i]) == \"-h\") {\r\n            \/\/ Print the usage message and exit\r\n            cout &lt;&lt; \"Usage: \" &lt;&lt; argv[0] &lt;&lt; \" --dir &lt;directory&gt; --csvfile &lt;csv file&gt; --type &lt;file type&gt;\\n\";\r\n            cout &lt;&lt; \"Options:\\n\";\r\n            cout &lt;&lt; \"  --dir &lt;directory&gt;   Specify the directory to scan recursively\\n\";\r\n            cout &lt;&lt; \"  --csvfile &lt;csv file&gt; Specify the output csv file name\\n\";\r\n            cout &lt;&lt; \"  --type &lt;file type&gt;   Specify the file extension type to filter\\n\";\r\n            cout &lt;&lt; \"  -h                   Show this help message and exit\\n\";\r\n            exit(0);\r\n        }\r\n        \/\/ Check if the argument is --dir\r\n        else if (string(argv[i]) == \"--dir\") {\r\n            \/\/ Check if the next argument exists and is not another option\r\n            if (i + 1 &lt; argc &amp;&amp; argv[i + 1][0] != '-') {\r\n                \/\/ Assign the next argument to dir\r\n                dir = argv[i + 1];\r\n                \/\/ Increment i to skip the next argument\r\n                i++;\r\n            }\r\n            else {\r\n                \/\/ Throw an exception if the argument is invalid\r\n                throw invalid_argument(\"Missing or invalid value for --dir\");\r\n            }\r\n        }\r\n        \/\/ Check if the argument is --csvfile\r\n        else if (string(argv[i]) == \"--csvfile\") {\r\n            \/\/ Check if the next argument exists and is not another option\r\n            if (i + 1 &lt; argc &amp;&amp; argv[i + 1][0] != '-') {\r\n                \/\/ Assign the next argument to csvfile\r\n                csvfile = argv[i + 1];\r\n                \/\/ Increment i to skip the next argument\r\n                i++;\r\n            }\r\n            else {\r\n                \/\/ Throw an exception if the argument is invalid\r\n                throw invalid_argument(\"Missing or invalid value for --csvfile\");\r\n            }\r\n        }\r\n        \/\/ Check if the argument is --type\r\n        else if (string(argv[i]) == \"--type\") {\r\n            \/\/ Check if the next argument exists and is not another option\r\n            if (i + 1 &lt; argc &amp;&amp; argv[i + 1][0] != '-') {\r\n                \/\/ Assign the next argument to type\r\n                type = argv[i + 1];\r\n                \/\/ Increment i to skip the next argument\r\n                i++;\r\n            }\r\n            else {\r\n                \/\/ Throw an exception if the argument is invalid\r\n                throw invalid_argument(\"Missing or invalid value for --type\");\r\n            }\r\n        }\r\n        else {\r\n            \/\/ Throw an exception if the argument is unknown\r\n            throw invalid_argument(\"Unknown option: \" + string(argv[i]));\r\n        }\r\n    }\r\n}\r\n<\/pre>\n<p>For FreeBSD 12.4 &#8211; I had to use gcc12 to compile it.<\/p>\n<p>for LLVM &#8211; c++<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">c++ -std=gnu++2a file_audit.cpp -o file_audit_2<\/pre>\n<p>Here is a typical run<\/p>\n<p>&nbsp;<\/p>\n<p>.\/file_audit &#8211;dir $HOME &#8211;type .py &#8211;csvfile test2.csv<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">[jon2allen@freebsd12_4 ~\/c++]$ head test2.csv\r\nFile Name,Directory,Size,Date\r\n\"daily_weather_obs_chart.py\",\"\/home\/jon2allen\/github\/weather_obs\",\"11008\",\"2023\/01\/24 10:43:09\"\r\n\"date_from_obs.py\",\"\/home\/jon2allen\/github\/weather_obs\",\"1540\",\"2023\/01\/24 10:43:09\"\r\n\"email_obs_err.py\",\"\/home\/jon2allen\/github\/weather_obs\",\"1078\",\"2023\/01\/24 10:43:09\"\r\n\"get_noaa_sites.py\",\"\/home\/jon2allen\/github\/weather_obs\",\"5233\",\"2023\/01\/24 10:43:09\"\r\n\"get_station_latest.py\",\"\/home\/jon2allen\/github\/weather_obs\",\"2234\",\"2023\/01\/24 10:43:09\"\r\n\"lambda_handler.py\",\"\/home\/jon2allen\/github\/weather_obs\",\"718\",\"2023\/01\/24 10:43:09\"\r\n\"noaa_duplicates.py\",\"\/home\/jon2allen\/github\/weather_obs\",\"1655\",\"2023\/01\/24 10:43:09\"\r\n\"noaa_tidal_potomac.py\",\"\/home\/jon2allen\/github\/weather_obs\",\"6490\",\"2023\/01\/24 10:43:09\"\r\n\"noaa_tide_chart_puller.py\",\"\/home\/jon2allen\/github\/weather_obs\",\"12372\",\"2023\/01\/24 10:43:09\"\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I first started with Python and that worked well.\u00a0 I then did a perl version.\u00a0 \u00a0That went well.\u00a0 \u00a0So, I thought &#8211; why not go for the jugular &#8211; write a c++ one.\u00a0 I call it file_audit &#8211; save a csv formatted file so I can review and sort by date to see what I need to save or delete.\u00a0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[28,31,30],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>ChatGPT - creating a C++ file search with csv output - Jon Allen&#039;s Linux Stuff<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ChatGPT - creating a C++ file search with csv output - Jon Allen&#039;s Linux Stuff\" \/>\n<meta property=\"og:description\" content=\"I first started with Python and that worked well.\u00a0 I then did a perl version.\u00a0 \u00a0That went well.\u00a0 \u00a0So, I thought &#8211; why not go for the jugular &#8211; write a c++ one.\u00a0 I call it file_audit &#8211; save a csv formatted file so I can review and sort by date to see what I need to save or delete.\u00a0 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/\" \/>\n<meta property=\"og:site_name\" content=\"Jon Allen&#039;s Linux Stuff\" \/>\n<meta property=\"article:published_time\" content=\"2023-05-24T12:48:52+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-05-26T14:49:23+00:00\" \/>\n<meta name=\"author\" content=\"jonallen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"jonallen\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/\"},\"author\":{\"name\":\"jonallen\",\"@id\":\"https:\/\/www.jibsheet.net\/linux\/#\/schema\/person\/295a80d0b2aa929b648c4fdddee83993\"},\"headline\":\"ChatGPT &#8211; creating a C++ file search with csv output\",\"datePublished\":\"2023-05-24T12:48:52+00:00\",\"dateModified\":\"2023-05-26T14:49:23+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/\"},\"wordCount\":150,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.jibsheet.net\/linux\/#\/schema\/person\/295a80d0b2aa929b648c4fdddee83993\"},\"articleSection\":[\"BSD\",\"c++\",\"ChatGPT\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/\",\"url\":\"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/\",\"name\":\"ChatGPT - creating a C++ file search with csv output - Jon Allen&#039;s Linux Stuff\",\"isPartOf\":{\"@id\":\"https:\/\/www.jibsheet.net\/linux\/#website\"},\"datePublished\":\"2023-05-24T12:48:52+00:00\",\"dateModified\":\"2023-05-26T14:49:23+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.jibsheet.net\/linux\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ChatGPT &#8211; creating a C++ file search with csv output\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.jibsheet.net\/linux\/#website\",\"url\":\"https:\/\/www.jibsheet.net\/linux\/\",\"name\":\"Jon Allen's Linux Stuff\",\"description\":\"Howto&#039;s, Observations, and stuff\",\"publisher\":{\"@id\":\"https:\/\/www.jibsheet.net\/linux\/#\/schema\/person\/295a80d0b2aa929b648c4fdddee83993\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.jibsheet.net\/linux\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.jibsheet.net\/linux\/#\/schema\/person\/295a80d0b2aa929b648c4fdddee83993\",\"name\":\"jonallen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.jibsheet.net\/linux\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/7d7c061ce9db8f5e4710555585475882?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/7d7c061ce9db8f5e4710555585475882?s=96&d=mm&r=g\",\"caption\":\"jonallen\"},\"logo\":{\"@id\":\"https:\/\/www.jibsheet.net\/linux\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/www.jibsheet.net\/linux\"]}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ChatGPT - creating a C++ file search with csv output - Jon Allen&#039;s Linux Stuff","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/","og_locale":"en_US","og_type":"article","og_title":"ChatGPT - creating a C++ file search with csv output - Jon Allen&#039;s Linux Stuff","og_description":"I first started with Python and that worked well.\u00a0 I then did a perl version.\u00a0 \u00a0That went well.\u00a0 \u00a0So, I thought &#8211; why not go for the jugular &#8211; write a c++ one.\u00a0 I call it file_audit &#8211; save a csv formatted file so I can review and sort by date to see what I need to save or delete.\u00a0 [&hellip;]","og_url":"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/","og_site_name":"Jon Allen&#039;s Linux Stuff","article_published_time":"2023-05-24T12:48:52+00:00","article_modified_time":"2023-05-26T14:49:23+00:00","author":"jonallen","twitter_card":"summary_large_image","twitter_misc":{"Written by":"jonallen","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/#article","isPartOf":{"@id":"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/"},"author":{"name":"jonallen","@id":"https:\/\/www.jibsheet.net\/linux\/#\/schema\/person\/295a80d0b2aa929b648c4fdddee83993"},"headline":"ChatGPT &#8211; creating a C++ file search with csv output","datePublished":"2023-05-24T12:48:52+00:00","dateModified":"2023-05-26T14:49:23+00:00","mainEntityOfPage":{"@id":"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/"},"wordCount":150,"commentCount":0,"publisher":{"@id":"https:\/\/www.jibsheet.net\/linux\/#\/schema\/person\/295a80d0b2aa929b648c4fdddee83993"},"articleSection":["BSD","c++","ChatGPT"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/","url":"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/","name":"ChatGPT - creating a C++ file search with csv output - Jon Allen&#039;s Linux Stuff","isPartOf":{"@id":"https:\/\/www.jibsheet.net\/linux\/#website"},"datePublished":"2023-05-24T12:48:52+00:00","dateModified":"2023-05-26T14:49:23+00:00","breadcrumb":{"@id":"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.jibsheet.net\/linux\/index.php\/2023\/05\/24\/chatgpt-creating-a-c-file-search-with-csv-output\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.jibsheet.net\/linux\/"},{"@type":"ListItem","position":2,"name":"ChatGPT &#8211; creating a C++ file search with csv output"}]},{"@type":"WebSite","@id":"https:\/\/www.jibsheet.net\/linux\/#website","url":"https:\/\/www.jibsheet.net\/linux\/","name":"Jon Allen's Linux Stuff","description":"Howto&#039;s, Observations, and stuff","publisher":{"@id":"https:\/\/www.jibsheet.net\/linux\/#\/schema\/person\/295a80d0b2aa929b648c4fdddee83993"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.jibsheet.net\/linux\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.jibsheet.net\/linux\/#\/schema\/person\/295a80d0b2aa929b648c4fdddee83993","name":"jonallen","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.jibsheet.net\/linux\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/7d7c061ce9db8f5e4710555585475882?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7d7c061ce9db8f5e4710555585475882?s=96&d=mm&r=g","caption":"jonallen"},"logo":{"@id":"https:\/\/www.jibsheet.net\/linux\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/www.jibsheet.net\/linux"]}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.jibsheet.net\/linux\/index.php\/wp-json\/wp\/v2\/posts\/382"}],"collection":[{"href":"https:\/\/www.jibsheet.net\/linux\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.jibsheet.net\/linux\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.jibsheet.net\/linux\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.jibsheet.net\/linux\/index.php\/wp-json\/wp\/v2\/comments?post=382"}],"version-history":[{"count":2,"href":"https:\/\/www.jibsheet.net\/linux\/index.php\/wp-json\/wp\/v2\/posts\/382\/revisions"}],"predecessor-version":[{"id":385,"href":"https:\/\/www.jibsheet.net\/linux\/index.php\/wp-json\/wp\/v2\/posts\/382\/revisions\/385"}],"wp:attachment":[{"href":"https:\/\/www.jibsheet.net\/linux\/index.php\/wp-json\/wp\/v2\/media?parent=382"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.jibsheet.net\/linux\/index.php\/wp-json\/wp\/v2\/categories?post=382"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.jibsheet.net\/linux\/index.php\/wp-json\/wp\/v2\/tags?post=382"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}