Question: I have a multiline string, which needs to be pasted and saved into a .txt file. I need also use some characters from the string as file name.

Here is an input example:

```none
ABCD 0000/20/02
Q) abc/yxz/IV/A /000/999
A) XYZ B) 2008311600 C) 2009301559
E) texttexttext
texttext

```

File name should contain 6 numbers after `B)` : `200831` and the extension `txt`.

That's what I have:

```
print ('Paste new NOTAM starting with AXXXX/20: ')    ##paste notam
lines = []
while True:
    line = input()
    if line:
        lines.append(line)
    else:
        break

file_name= line[line.find("B) ")[6]:]
print (file_name)

with open(input(file_name + '.txt', "w+")) as f:
    for line in lines:
        f.write(line)
        f.write('\n')

```

Answer: 
I solved it. Problem is with plugin.
In config options of gatsby-source-woocommerce,
comment everything after fields i.e After commenting it looks like,

```
{
      resolve: "@pasdo501/gatsby-source-woocommerce",
      options: {

        // Base URL of Wordpress site

        api: "wordpress.domain",

        // set to false to not see verbose output during build
        // default: true
        verbose: true,

        // true if using https. otherwise false.
        https: false,
        api_keys: {
          consumer_key: <key>,
          consumer_secret: <secret>,
        },
        // Array of strings with fields you'd like to create nodes for...
        fields: ["products", "products/categories", "products/attributes"],

      },
    },

```

Head to the @pasdo501/gatsby-source-woocommerce folder ( node modules ) -> gatsby-node.js
change api\_version = "wc/v3" to "wc/v2" and
change wpAPIPrefix = null to "wp-json"
and save it.

voila
no need to change the package. you can do this:

* add `/index.php` to the end of `api`.
* set `wpAPIPrefix` to `wp-json`.
* set `query_string_auth` to `true` (I,m not sure if this one necessary).

```
{
  resolve: '@pasdo501/gatsby-source-woocommerce',
  options: {
    api: 'pro.com/index.php',
    https: true,
    verbose: true,
    api_keys: {
      consumer_key: `ck_...........`,
      consumer_secret: `cs_.................`,
    },
    fields: ['products', 'products/categories', 'products/attributes', 'products/tags'],
    wpAPIPrefix: 'wp-json',
    query_string_auth: true,
    api_version: 'wc/v3',
    // per_page: 100,
    // encoding: 'utf8',
    // axios_config: {}
  }
}

```