{ "cells": [ { "cell_type": "code", "execution_count": 11, "id": "technical-deadline", "metadata": {}, "outputs": [], "source": [ "startFixing = False\n", "allIPLines = []\n", "fIP = open('Finalized Queries-Copy1.ipynb','r')\n", "allIPLines = fIP.read().split(\"\\n\")\n", "# with open('Finalized Queries-Copy2.ipynb', 'w') as fOP:\n", "\n", "# print(fIP.read())\n", "# for line1 in fIP:\n", "# if startFixing:\n", " \n", "# elif not(startFixing):\n", "# if \"-o ../../opAnalysis/removed_statements_both_nonredirects_num_new_vals_rightone.tsv\" in line1:\n", "# startFixing = True\n", " \n", " " ] }, { "cell_type": "code", "execution_count": 25, "id": "powered-mechanics", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "4863130\n" ] } ], "source": [ "for i in range(len(allIPLines)):\n", " if \"!cat ../../opAnalysis/removed_statements_both_nonredirects_num_new_vals_rightone.tsv\" in allIPLines[i]:\n", " print(i)\n", " break" ] }, { "cell_type": "code", "execution_count": 22, "id": "mediterranean-pakistan", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "[' \" -o ../../opAnalysis/removed_statements_both_nonredirects_num_new_vals_rightone.tsv\\\\n\"',\n", " ' ]',\n", " ' },',\n", " ' {',\n", " ' \"cell_type\": \"code\",',\n", " ' \"execution_count\": null,',\n", " ' \"id\": \"unlikely-overhead\",',\n", " ' \"metadata\": {},',\n", " ' \"outputs\": [',\n", " ' {',\n", " ' \"name\": \"stdout\",',\n", " ' \"output_type\": \"stream\",',\n", " ' \"text\": [',\n", " ' \"node1\\\\tlabel\\\\tnode2\\\\tnewNode2Label\\\\tnewNode2\\\\r\\\\n\",']" ] }, "execution_count": 22, "metadata": {}, "output_type": "execute_result" } ], "source": [ "allIPLines[2377:2391]" ] }, { "cell_type": "code", "execution_count": 24, "id": "mathematical-laundry", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "' \"node1\\\\tlabel\\\\tnode2\\\\tnewNode2Label\\\\tnewNode2\\\\r\\\\n\",'" ] }, "execution_count": 24, "metadata": {}, "output_type": "execute_result" } ], "source": [ "allIPLines[2390]" ] }, { "cell_type": "code", "execution_count": 30, "id": "smooth-maple", "metadata": {}, "outputs": [ { "data": { "text/plain": [ "' ]'" ] }, "execution_count": 30, "metadata": {}, "output_type": "execute_result" } ], "source": [ "allIPLines[4863126]" ] }, { "cell_type": "code", "execution_count": 42, "id": "naked-telephone", "metadata": {}, "outputs": [], "source": [ "fOP = open('Finalized Queries-Copy2.ipynb', 'w')" ] }, { "cell_type": "code", "execution_count": 43, "id": "cardiovascular-welsh", "metadata": {}, "outputs": [], "source": [ "for i in range(len(allIPLines)):\n", " if i < 2390 or i >= 4863126:\n", " fOP.write(allIPLines[i]+\"\\n\")" ] }, { "cell_type": "code", "execution_count": 44, "id": "broken-titanium", "metadata": {}, "outputs": [], "source": [ "fOP.close()" ] }, { "cell_type": "code", "execution_count": 40, "id": "located-deviation", "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "5555" ] } ], "source": [ "!cat \"Finalized Queries-Copy2.ipynb\"" ] }, { "cell_type": "code", "execution_count": null, "id": "persistent-queensland", "metadata": {}, "outputs": [], "source": [] }, { "cell_type": "code", "execution_count": null, "id": "coastal-placement", "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "kernelspec": { "display_name": "kgtkEnv", "language": "python", "name": "kgtkenv" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.8.5" }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": false, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": false, "toc_position": {}, "toc_section_display": true, "toc_window_display": false }, "varInspector": { "cols": { "lenName": 16, "lenType": 16, "lenVar": 40 }, "kernels_config": { "python": { "delete_cmd_postfix": "", "delete_cmd_prefix": "del ", "library": "var_list.py", "varRefreshCmd": "print(var_dic_list())" }, "r": { "delete_cmd_postfix": ") ", "delete_cmd_prefix": "rm(", "library": "var_list.r", "varRefreshCmd": "cat(var_dic_list()) " } }, "types_to_exclude": [ "module", "function", "builtin_function_or_method", "instance", "_Feature" ], "window_display": false } }, "nbformat": 4, "nbformat_minor": 5 }