Change the date format in JOLT

In the attached JOLT, I want to change the date format, type conversion and string operation as follows.

  • Date needs to change into yyyy-mm-dd hh:mm:ss format (2024-06-16 23:54:14) from UTC (2024-06-16T23:54:14.711456Z)
  • The value of WEIGHT code needs to convert into decimal from string
  • for machinename, needs to get only the name

Can someone please help on this. Thank you

Input JSON

{
  "machine": "26619",
  "mname": "MapRecord[{name=machine_col}]",
  "timestamp": "2024-06-16T23:54:14.711456Z",
  "temp": "16.0",
  "height": "0.151",
  "site": "2343",
  "weight": "0.2955",
  "length": "0.2"
}

JOLT:

[
  {
    "operation": "shift",
    "spec": {
      "mname": "machinename",
      "timestamp": "Date",
      "temp": {
        "@": "data[0].value",
        "#A2-P1-M1 5cm": "data[0].code"
      },
      "height": {
        "@": "data[1].value",
        "#A1-P1-T1 5cm": "data[1].code"
      },
      "weight": {
        "@": "data[2].value",
        "#WEIGHT": "data[2].code"
      }
    }
  }
]

Expected JSON Output :

{
  "machinename": "machine_col",
  "Date": "2024-06-16 23:54:14",
  "data": [
    {
      "value": "16.0",
      "code": "A2-P1-M1 5cm"
    },
    {
      "value": "0.151",
      "code": "A1-P1-T1 5cm"
    },
    {
      "value": 0.2955,
      "code": "WEIGHT"
    }
  ]
}

Error: ‘flutter’ is not an internal or external command

This error typically indicates that the Flutter command-line interface (CLI) is not recognized by your system. It often occurs due to issues with the PATH environment variable. Here’s a step-by-step guide to resolve this:

1. Verify Flutter Installation:

  • Ensure you have correctly installed the Flutter SDK.
  • Locate the directory where you installed it (e.g., C:\flutter).
  • Confirm the presence of the bin folder, which contains the flutter executable.

2. Set Up PATH Environment Variable:

  • Open Environment Variables:
    • Right-click on “This PC” or “My Computer” and select “Properties.”
    • Click on “Advanced system settings” on the left-hand side.
    • In the “System Properties” window, click on the “Environment Variables” button.
  • Edit PATH Variable:
    • Find the “Path” variable under “System variables” (or “User variables” if you want it to apply only to your user account).
    • Click on “Edit.”
    • Add the path to the flutter\bin directory. For example, if you installed Flutter in C:\flutter, add C:\flutter\bin to the PATH.
    • Click “OK” to save your changes.
  • Close and Reopen Command Prompt:
    • Close any open Command Prompt or PowerShell windows and open a new one.

3. Verify Installation:

  • In the new Command Prompt or PowerShell window, run: Bashflutter doctor

Use code with caution.

  • This command will verify your Flutter installation and list any missing dependencies or setup requirements.

4. Additional Checks (If the Issue Persists):

  • Check Installation Location: Avoid paths with spaces or special characters (e.g., C:\Program Files\flutter). If necessary, move the Flutter SDK to a simpler path.
  • Restart Your Computer: Restarting your computer can ensure that the PATH variable changes take effect.

5. Troubleshooting Tips:

  • Double-Check PATH: Verify that you’ve added the correct path to the flutter\bin directory and that there are no typos or extra spaces.
  • Environment Variables: Ensure that you’re editing the “System variables” PATH, not the “User variables” PATH, if you want the changes to apply to all users.
  • Permissions: Make sure you have the necessary permissions to modify environment variables.
  • Multiple Flutter Installations: If you have multiple Flutter installations, ensure you’re using the correct path.

By following these steps and considering the additional troubleshooting tips, you should be able to successfully resolve the ‘flutter’ is not an internal or external command error and start using the Flutter CLI.