{"id":21614,"date":"2020-08-25T15:15:47","date_gmt":"2020-08-25T22:15:47","guid":{"rendered":"https:\/\/careerkarma.com\/blog\/?p=21614"},"modified":"2023-12-01T03:58:48","modified_gmt":"2023-12-01T11:58:48","slug":"python-read-text-file-into-list","status":"publish","type":"post","link":"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/","title":{"rendered":"Python: Read Text File into List"},"content":{"rendered":"\n<p><a href=\"https:\/\/careerkarma.com\/blog\/python-read-file\/\">Storing data in files<\/a> lets you keep a record of the data with which a program is working. This means you don\u2019t have to generate data over again when working with a program. You just read that data from a file.<br><\/p>\n\n\n\n<p>To read files, use the <code>readlines()<\/code> method. Once you\u2019ve read a file, you use <code>split()<\/code> to turn those lines into a list.<br><\/p>\n\n\n\n<p>In this guide, we discuss how to use the <code>split()<\/code> method to read a text file into a list. We\u2019ll refer to an example so you can get started reading text files into lists quickly.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Python: Read Text File into List<\/h2>\n\n\n\n<p>Let\u2019s start with a text file called grilled_cheese.txt. This file contains the ingredients for a grilled cheese sandwich. Our file content looks like this:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>2 tbsp, ricotta\n1 tbsp, grated parmesan\n50g, mozzarella\n25g, gorgonzola\n2, thick slices white bread\n1 tbsp, butter<\/pre><\/div>\n\n\n\n<p>The first column in our file contains the quantity of each ingredient to be used. The second column contains the name of an ingredient.<br><\/p>\n\n\n\n<p>We read this file into our code using the <code>open()<\/code> and <code>readlines()<\/code> methods:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>with open(&quot;grilled_cheese.txt&quot;, &quot;r&quot;) as grilled_cheese:\n\tlines = grilled_cheese.readlines()\n\tprint(lines)<\/pre><\/div>\n\n\n\n<p>In our code, we open a file called \u201cgrilled_cheese.txt\u201d in read mode. Read mode is denoted by the \u201cr\u201d character in our <code>open()<\/code> statement. Next, we print those lines to the console.<br><\/p>\n\n\n\n<p>Let\u2019s see what our Python code returns:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>['2 tbsp, ricotta\\n', '1 tbsp, grated parmesan\\n', '50g, mozzarella\\n', '25g, gorgonzola\\n', '2, thick slices white bread\\n', '1 tbsp, butter\\n']<\/pre><\/div>\n\n\n\n<p>Our code returns a <a href=\"https:\/\/careerkarma.com\/blog\/python-array\/\">list<\/a> of each line in our file. This is not quite the output we are expecting. While we\u2019ve read our file into a list, we have a problem: each line is stored in its own string. Ingredients and their quantities are not separate.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Divide Values into a List<\/h2>\n\n\n\n<p>To solve this problem, we use the <a href=\"https:\/\/careerkarma.com\/blog\/python-split\/\">split() method<\/a>. This method lets us divide a string using a separator character we specify.<br><\/p>\n\n\n\n<p>To start, we declare two lists: quantities and ingredients. This code will remain indented because it is part of our <code>open()<\/code> block of code.<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>\tquantities = []\n\tingredients = []<\/pre><\/div>\n\n\n\n<p>We\u2019ll iterate over our list so we can access each line of text from our file. Then we\u2019ll split each line into two parts. The dividing point is the comma followed by a space on each line:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>for l in lines:\n\t\t as_list = l.split(&quot;, &quot;)\n\t\t quantities.append(as_list[0])\n\t\t ingredients.append(as_list[1])<\/pre><\/div>\n\n\n\n<p>The <a href=\"https:\/\/careerkarma.com\/blog\/python-for-loop\/\">for loop<\/a> lets us read our file line by line. The first value in \u201cas_list\u201d is the quantity of an ingredient. The second value is the name of the ingredient. We then print both of these lists to the console:<br><\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>\tprint(quantities)\n\tprint(ingredients)<\/pre><\/div>\n\n\n\n<p>Let\u2019s run our code:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>['2 tbsp, ricotta\\n', '1 tbsp, grated parmesan\\n', '50g, mozzarella\\n', '25g, gorgonzola\\n', '2, thick slices white bread\\n', '1 tbsp, butter\\n']\n['2 tbsp', '1 tbsp', '50g', '25g', '2', '1 tbsp']\n['ricotta\\n', 'grated parmesan\\n', 'mozzarella\\n', 'gorgonzola\\n', 'thick slices white bread\\n', 'butter\\n']<\/pre><\/div>\n\n\n\n<p>Our code prints three lists to the console. The first list is a list of all the lines of text in our file. The second list contains all the quantities from our file. The third list contains all the ingredients.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Remove New Lines<\/h2>\n\n\n\n<p>There is still one improvement that we need to make. Every ingredient ends in the <a href=\"https:\/\/careerkarma.com\/blog\/python-print-without-new-line\/\">\u201c\\n\u201d character<\/a>. This character denotes a new line. We can remove this character by using the <a href=\"https:\/\/careerkarma.com\/blog\/python-remove-character-from-string\/\">replace() method<\/a>:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>for l in lines:\n\t   \t  as_list = l.split(&quot;, &quot;)\n\t\t  quantities.append(as_list[0])\n\t\t  ingredients.append(as_list[1].replace(&quot;\\n&quot;, &quot;&quot;))<\/pre><\/div>\n\n\n\n<p>In our for loop, we replace the value \u201c\\n\u201d with an empty string. We do this on the as_list[1] value which correlates to the name of each ingredient.<br><\/p>\n\n\n\n<p>Now that we\u2019ve made this change, our program is ready:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>with open(&quot;grilled_cheese.txt&quot;, &quot;r&quot;) as grilled_cheese:\n\t   lines = grilled_cheese.readlines()\n\n\t   quantities = []\n\t   ingredients = []\n\n\t   for l in lines:\n\t  \t\t\t as_list = l.split(&quot;, &quot;)\n\t\t\t     quantities.append(as_list[0])\n\t\t\t     ingredients.append(as_list[1].replace(&quot;\\n&quot;, &quot;&quot;))\n\n\t   print(quantities)\n\t   print(ingredients)<\/pre><\/div>\n\n\n\n<p>Let\u2019s run our code and see what happens:<\/p>\n\n\n\n<div class=\"wp-block-codemirror-blocks-code-block code-block\"><pre>['2 tbsp', '1 tbsp', '50g', '25g', '2', '1 tbsp']\n['ricotta', 'grated parmesan', 'mozzarella', 'gorgonzola', 'thick slices white bread', 'butter']<\/pre><\/div>\n\n\n\n<p>Our code successfully transforms our text file into two lists. One list contains the quantities of ingredients for a recipe. The other list contains the ingredients we&#8217;ll use for the recipe.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p>You can read a text file using the <code>open()<\/code> and <code>readlines()<\/code> methods. To read a text file into a list, use the <code>split()<\/code> method. This method splits strings into a list at a certain character.<br><\/p>\n\n\n\n<p>In the example above, we split a string into a list based on the position of a comma and a space (\u201c, \u201d). Now you\u2019re ready to read a text file into a list in Python like an expert.<\/p>\n","protected":false},"excerpt":{"rendered":"Storing data in files lets you keep a record of the data with which a program is working. This means you don\u2019t have to generate data over again when working with a program. You just read that data from a file. To read files, use the readlines() method. Once you\u2019ve read a file, you use&hellip;","protected":false},"author":240,"featured_media":21615,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[16578],"tags":[],"class_list":{"0":"post-21614","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-python"},"acf":{"post_sub_title":"","sprint_id":"","query_class":"Python","school_sft":"","parent_sft":"","school_privacy_policy":"","has_review":null,"is_sponser_post":"","is_guest_post":""},"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.0) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Python: Read Text File into List | Career Karma<\/title>\n<meta name=\"description\" content=\"On Career Karma, learn how to read a text file into a list using the readlines() and split() methods.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python: Read Text File into List\" \/>\n<meta property=\"og:description\" content=\"On Career Karma, learn how to read a text file into a list using the readlines() and split() methods.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/\" \/>\n<meta property=\"og:site_name\" content=\"Career Karma\" \/>\n<meta property=\"article:publisher\" content=\"http:\/\/facebook.com\/careerkarmaapp\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-25T22:15:47+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-12-01T11:58:48+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/clement-h-95YRwf6CNw8-unsplash.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1020\" \/>\n\t<meta property=\"og:image:height\" content=\"680\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"James Gallagher\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@career_karma\" \/>\n<meta name=\"twitter:site\" content=\"@career_karma\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"James Gallagher\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/\"},\"author\":{\"name\":\"James Gallagher\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"headline\":\"Python: Read Text File into List\",\"datePublished\":\"2020-08-25T22:15:47+00:00\",\"dateModified\":\"2023-12-01T11:58:48+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/\"},\"wordCount\":625,\"commentCount\":0,\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/clement-h-95YRwf6CNw8-unsplash.jpg\",\"articleSection\":[\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/\",\"name\":\"Python: Read Text File into List | Career Karma\",\"isPartOf\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/clement-h-95YRwf6CNw8-unsplash.jpg\",\"datePublished\":\"2020-08-25T22:15:47+00:00\",\"dateModified\":\"2023-12-01T11:58:48+00:00\",\"author\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\"},\"description\":\"On Career Karma, learn how to read a text file into a list using the readlines() and split() methods.\",\"breadcrumb\":{\"@id\":\"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#primaryimage\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/clement-h-95YRwf6CNw8-unsplash.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/clement-h-95YRwf6CNw8-unsplash.jpg\",\"width\":1020,\"height\":680,\"caption\":\"A black and silver laptop with code running on a table next to a plant and a yellow mug.\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Blog\",\"item\":\"https:\/\/careerkarma.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Python\",\"item\":\"https:\/\/careerkarma.com\/blog\/python\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Python: Read Text File into List\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#website\",\"url\":\"https:\/\/careerkarma.com\/blog\/\",\"name\":\"Career Karma\",\"description\":\"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/careerkarma.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94\",\"name\":\"James Gallagher\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"contentUrl\":\"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg\",\"caption\":\"James Gallagher\"},\"description\":\"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.\",\"url\":\"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Python: Read Text File into List | Career Karma","description":"On Career Karma, learn how to read a text file into a list using the readlines() and split() methods.","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:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/","og_locale":"en_US","og_type":"article","og_title":"Python: Read Text File into List","og_description":"On Career Karma, learn how to read a text file into a list using the readlines() and split() methods.","og_url":"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/","og_site_name":"Career Karma","article_publisher":"http:\/\/facebook.com\/careerkarmaapp","article_published_time":"2020-08-25T22:15:47+00:00","article_modified_time":"2023-12-01T11:58:48+00:00","og_image":[{"width":1020,"height":680,"url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/clement-h-95YRwf6CNw8-unsplash.jpg","type":"image\/jpeg"}],"author":"James Gallagher","twitter_card":"summary_large_image","twitter_creator":"@career_karma","twitter_site":"@career_karma","twitter_misc":{"Written by":"James Gallagher","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#article","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/"},"author":{"name":"James Gallagher","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"headline":"Python: Read Text File into List","datePublished":"2020-08-25T22:15:47+00:00","dateModified":"2023-12-01T11:58:48+00:00","mainEntityOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/"},"wordCount":625,"commentCount":0,"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/clement-h-95YRwf6CNw8-unsplash.jpg","articleSection":["Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/","url":"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/","name":"Python: Read Text File into List | Career Karma","isPartOf":{"@id":"https:\/\/careerkarma.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#primaryimage"},"image":{"@id":"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#primaryimage"},"thumbnailUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/clement-h-95YRwf6CNw8-unsplash.jpg","datePublished":"2020-08-25T22:15:47+00:00","dateModified":"2023-12-01T11:58:48+00:00","author":{"@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94"},"description":"On Career Karma, learn how to read a text file into a list using the readlines() and split() methods.","breadcrumb":{"@id":"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#primaryimage","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/clement-h-95YRwf6CNw8-unsplash.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/08\/clement-h-95YRwf6CNw8-unsplash.jpg","width":1020,"height":680,"caption":"A black and silver laptop with code running on a table next to a plant and a yellow mug."},{"@type":"BreadcrumbList","@id":"https:\/\/careerkarma.com\/blog\/python-read-text-file-into-list\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog","item":"https:\/\/careerkarma.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Python","item":"https:\/\/careerkarma.com\/blog\/python\/"},{"@type":"ListItem","position":3,"name":"Python: Read Text File into List"}]},{"@type":"WebSite","@id":"https:\/\/careerkarma.com\/blog\/#website","url":"https:\/\/careerkarma.com\/blog\/","name":"Career Karma","description":"Latest Coding Bootcamp News &amp; Career Hacks from Industry Insiders","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/careerkarma.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/e79364792443fbff794a144c67ec8e94","name":"James Gallagher","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/careerkarma.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","contentUrl":"https:\/\/careerkarma.com\/blog\/wp-content\/uploads\/2020\/01\/james-gallagher-150x150.jpg","caption":"James Gallagher"},"description":"James Gallagher is a self-taught programmer and the technical content manager at Career Karma. He has experience in range of programming languages and extensive expertise in Python, HTML, CSS, and JavaScript. James has written hundreds of programming tutorials, and he frequently contributes to publications like Codecademy, Treehouse, Repl.it, Afrotech, and others.","url":"https:\/\/careerkarma.com\/blog\/author\/jamesgallagher\/"}]}},"_links":{"self":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/21614","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/users\/240"}],"replies":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/comments?post=21614"}],"version-history":[{"count":0,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/posts\/21614\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media\/21615"}],"wp:attachment":[{"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/media?parent=21614"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/categories?post=21614"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/careerkarma.com\/blog\/wp-json\/wp\/v2\/tags?post=21614"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}